@langchain/core 1.0.6 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/agents.cjs +1 -0
- package/agents.d.cts +1 -0
- package/agents.d.ts +1 -0
- package/agents.js +1 -0
- package/caches.cjs +1 -0
- package/caches.d.cts +1 -0
- package/caches.d.ts +1 -0
- package/caches.js +1 -0
- package/callbacks/base.cjs +1 -0
- package/callbacks/base.d.cts +1 -0
- package/callbacks/base.d.ts +1 -0
- package/callbacks/base.js +1 -0
- package/callbacks/dispatch/web.cjs +1 -0
- package/callbacks/dispatch/web.d.cts +1 -0
- package/callbacks/dispatch/web.d.ts +1 -0
- package/callbacks/dispatch/web.js +1 -0
- package/callbacks/dispatch.cjs +1 -0
- package/callbacks/dispatch.d.cts +1 -0
- package/callbacks/dispatch.d.ts +1 -0
- package/callbacks/dispatch.js +1 -0
- package/callbacks/manager.cjs +1 -0
- package/callbacks/manager.d.cts +1 -0
- package/callbacks/manager.d.ts +1 -0
- package/callbacks/manager.js +1 -0
- package/callbacks/promises.cjs +1 -0
- package/callbacks/promises.d.cts +1 -0
- package/callbacks/promises.d.ts +1 -0
- package/callbacks/promises.js +1 -0
- package/chat_history.cjs +1 -0
- package/chat_history.d.cts +1 -0
- package/chat_history.d.ts +1 -0
- package/chat_history.js +1 -0
- package/context.cjs +1 -0
- package/context.d.cts +1 -0
- package/context.d.ts +1 -0
- package/context.js +1 -0
- package/dist/caches/{base.cjs → index.cjs} +6 -6
- package/dist/caches/index.cjs.map +1 -0
- package/dist/caches/{base.d.cts → index.d.cts} +2 -2
- package/dist/caches/{base.d.ts → index.d.ts} +2 -2
- package/dist/caches/{base.js → index.js} +5 -5
- package/dist/caches/index.js.map +1 -0
- package/dist/callbacks/dispatch/index.d.ts +1 -0
- package/dist/callbacks/dispatch/web.d.ts +1 -0
- package/dist/chat_history.d.ts +1 -0
- package/dist/language_models/base.cjs +2 -2
- package/dist/language_models/base.cjs.map +1 -1
- package/dist/language_models/base.d.cts +1 -1
- package/dist/language_models/base.d.ts +3 -1
- package/dist/language_models/base.js +1 -1
- package/dist/language_models/base.js.map +1 -1
- package/dist/language_models/chat_models.cjs.map +1 -1
- package/dist/language_models/chat_models.d.cts +1 -1
- package/dist/language_models/chat_models.d.ts +4 -1
- package/dist/language_models/chat_models.js.map +1 -1
- package/dist/language_models/llms.cjs.map +1 -1
- package/dist/language_models/llms.d.cts +1 -1
- package/dist/language_models/llms.d.ts +2 -1
- package/dist/language_models/llms.js.map +1 -1
- package/dist/load/import_constants.cjs +1 -0
- package/dist/load/import_constants.cjs.map +1 -1
- package/dist/load/import_constants.js +1 -0
- package/dist/load/import_constants.js.map +1 -1
- package/dist/load/import_map.cjs +12 -12
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +16 -16
- package/dist/load/import_map.js.map +1 -1
- package/dist/messages/base.cjs +10 -3
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.js +10 -3
- package/dist/messages/base.js.map +1 -1
- package/dist/messages/message.d.cts +1 -1
- package/dist/messages/message.d.ts +1 -1
- package/dist/messages/system.cjs +25 -1
- package/dist/messages/system.cjs.map +1 -1
- package/dist/messages/system.d.cts +6 -0
- package/dist/messages/system.d.ts +6 -0
- package/dist/messages/system.js +25 -1
- package/dist/messages/system.js.map +1 -1
- package/dist/messages/transformers.d.cts +2 -1
- package/dist/messages/transformers.d.ts +2 -1
- package/dist/messages/utils.d.cts +8 -8
- package/dist/messages/utils.d.ts +8 -8
- package/dist/output_parsers/base.d.ts +3 -0
- package/dist/output_parsers/index.cjs +1 -1
- package/dist/output_parsers/index.js +1 -1
- package/dist/output_parsers/list.d.ts +1 -0
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +1 -1
- package/dist/output_parsers/string.d.ts +1 -0
- package/dist/prompts/base.d.ts +1 -0
- package/dist/prompts/chat.d.ts +1 -0
- package/dist/prompts/few_shot.d.ts +1 -0
- package/dist/prompts/image.d.ts +1 -0
- package/dist/prompts/prompt.d.ts +1 -0
- package/dist/prompts/serde.d.ts +1 -0
- package/dist/prompts/structured.d.ts +1 -1
- package/dist/prompts/template.d.ts +1 -1
- package/dist/retrievers/document_compressors/{base.cjs → index.cjs} +6 -6
- package/dist/retrievers/document_compressors/index.cjs.map +1 -0
- package/dist/retrievers/document_compressors/{base.d.cts → index.d.cts} +2 -2
- package/dist/retrievers/document_compressors/{base.d.ts → index.d.ts} +2 -2
- package/dist/retrievers/document_compressors/index.js +17 -0
- package/dist/retrievers/document_compressors/index.js.map +1 -0
- package/dist/retrievers/index.d.ts +1 -0
- package/dist/runnables/base.cjs +2 -2
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts +0 -17
- package/dist/runnables/base.d.ts +0 -17
- package/dist/runnables/base.js +2 -2
- package/dist/runnables/base.js.map +1 -1
- package/dist/runnables/branch.d.ts +1 -0
- package/dist/runnables/history.d.ts +2 -0
- package/dist/runnables/index.cjs +4 -1
- package/dist/runnables/index.cjs.map +1 -1
- package/dist/runnables/index.d.cts +2 -1
- package/dist/runnables/index.d.ts +2 -1
- package/dist/runnables/index.js +4 -2
- package/dist/runnables/index.js.map +1 -1
- package/dist/runnables/passthrough.d.ts +1 -0
- package/dist/runnables/router.d.ts +1 -0
- package/dist/tools/index.cjs +9 -1
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +7 -0
- package/dist/tools/index.d.ts +9 -0
- package/dist/tools/index.js +10 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.cjs.map +1 -1
- package/dist/tools/types.d.cts +15 -14
- package/dist/tools/types.d.ts +17 -14
- package/dist/tools/types.js.map +1 -1
- package/dist/tracers/event_stream.d.ts +1 -0
- package/dist/utils/async_caller.cjs +9 -4
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.js +8 -3
- package/dist/utils/async_caller.js.map +1 -1
- package/dist/utils/fast-json-patch/src/core.d.cts +0 -18
- package/dist/utils/fast-json-patch/src/core.d.ts +0 -18
- package/dist/utils/json_schema.d.cts +0 -5
- package/dist/utils/json_schema.d.ts +1 -5
- package/dist/utils/signal.d.cts +13 -0
- package/dist/utils/signal.d.ts +13 -0
- package/dist/utils/testing/chat_models.d.ts +1 -0
- package/dist/utils/testing/message_history.d.ts +1 -0
- package/dist/utils/types/index.cjs +2 -0
- package/dist/utils/types/index.d.cts +2 -2
- package/dist/utils/types/index.d.ts +2 -2
- package/dist/utils/types/index.js +3 -2
- package/dist/utils/types/zod.cjs +4 -0
- package/dist/utils/types/zod.cjs.map +1 -1
- package/dist/utils/types/zod.d.cts +3 -2
- package/dist/utils/types/zod.d.ts +3 -2
- package/dist/utils/types/zod.js +4 -1
- package/dist/utils/types/zod.js.map +1 -1
- package/dist/utils/zod-to-json-schema/Options.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/Refs.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/index.d.ts +37 -0
- package/dist/utils/zod-to-json-schema/parseDef.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/branded.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/catch.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/default.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/effects.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts +2 -0
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/optional.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/pipeline.d.ts +4 -0
- package/dist/utils/zod-to-json-schema/parsers/promise.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/readonly.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts +2 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts +1 -0
- package/dist/utils/zod-to-json-schema/selectParser.d.ts +3 -0
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.d.ts +3 -0
- package/document_loaders/base.cjs +1 -0
- package/document_loaders/base.d.cts +1 -0
- package/document_loaders/base.d.ts +1 -0
- package/document_loaders/base.js +1 -0
- package/document_loaders/langsmith.cjs +1 -0
- package/document_loaders/langsmith.d.cts +1 -0
- package/document_loaders/langsmith.d.ts +1 -0
- package/document_loaders/langsmith.js +1 -0
- package/documents.cjs +1 -0
- package/documents.d.cts +1 -0
- package/documents.d.ts +1 -0
- package/documents.js +1 -0
- package/embeddings.cjs +1 -0
- package/embeddings.d.cts +1 -0
- package/embeddings.d.ts +1 -0
- package/embeddings.js +1 -0
- package/example_selectors.cjs +1 -0
- package/example_selectors.d.cts +1 -0
- package/example_selectors.d.ts +1 -0
- package/example_selectors.js +1 -0
- package/indexing.cjs +1 -0
- package/indexing.d.cts +1 -0
- package/indexing.d.ts +1 -0
- package/indexing.js +1 -0
- package/language_models/base.cjs +1 -0
- package/language_models/base.d.cts +1 -0
- package/language_models/base.d.ts +1 -0
- package/language_models/base.js +1 -0
- package/language_models/chat_models.cjs +1 -0
- package/language_models/chat_models.d.cts +1 -0
- package/language_models/chat_models.d.ts +1 -0
- package/language_models/chat_models.js +1 -0
- package/language_models/llms.cjs +1 -0
- package/language_models/llms.d.cts +1 -0
- package/language_models/llms.d.ts +1 -0
- package/language_models/llms.js +1 -0
- package/language_models/profile.cjs +1 -0
- package/language_models/profile.d.cts +1 -0
- package/language_models/profile.d.ts +1 -0
- package/language_models/profile.js +1 -0
- package/load/serializable.cjs +1 -0
- package/load/serializable.d.cts +1 -0
- package/load/serializable.d.ts +1 -0
- package/load/serializable.js +1 -0
- package/load.cjs +1 -0
- package/load.d.cts +1 -0
- package/load.d.ts +1 -0
- package/load.js +1 -0
- package/memory.cjs +1 -0
- package/memory.d.cts +1 -0
- package/memory.d.ts +1 -0
- package/memory.js +1 -0
- package/messages/tool.cjs +1 -0
- package/messages/tool.d.cts +1 -0
- package/messages/tool.d.ts +1 -0
- package/messages/tool.js +1 -0
- package/messages.cjs +1 -0
- package/messages.d.cts +1 -0
- package/messages.d.ts +1 -0
- package/messages.js +1 -0
- package/output_parsers/openai_functions.cjs +1 -0
- package/output_parsers/openai_functions.d.cts +1 -0
- package/output_parsers/openai_functions.d.ts +1 -0
- package/output_parsers/openai_functions.js +1 -0
- package/output_parsers/openai_tools.cjs +1 -0
- package/output_parsers/openai_tools.d.cts +1 -0
- package/output_parsers/openai_tools.d.ts +1 -0
- package/output_parsers/openai_tools.js +1 -0
- package/output_parsers.cjs +1 -0
- package/output_parsers.d.cts +1 -0
- package/output_parsers.d.ts +1 -0
- package/output_parsers.js +1 -0
- package/outputs.cjs +1 -0
- package/outputs.d.cts +1 -0
- package/outputs.d.ts +1 -0
- package/outputs.js +1 -0
- package/package.json +163 -63
- package/prompt_values.cjs +1 -0
- package/prompt_values.d.cts +1 -0
- package/prompt_values.d.ts +1 -0
- package/prompt_values.js +1 -0
- package/prompts.cjs +1 -0
- package/prompts.d.cts +1 -0
- package/prompts.d.ts +1 -0
- package/prompts.js +1 -0
- package/retrievers/document_compressors.cjs +1 -0
- package/retrievers/document_compressors.d.cts +1 -0
- package/retrievers/document_compressors.d.ts +1 -0
- package/retrievers/document_compressors.js +1 -0
- package/retrievers.cjs +1 -0
- package/retrievers.d.cts +1 -0
- package/retrievers.d.ts +1 -0
- package/retrievers.js +1 -0
- package/runnables/graph.cjs +1 -0
- package/runnables/graph.d.cts +1 -0
- package/runnables/graph.d.ts +1 -0
- package/runnables/graph.js +1 -0
- package/runnables.cjs +1 -0
- package/runnables.d.cts +1 -0
- package/runnables.d.ts +1 -0
- package/runnables.js +1 -0
- package/singletons.cjs +1 -0
- package/singletons.d.cts +1 -0
- package/singletons.d.ts +1 -0
- package/singletons.js +1 -0
- package/stores.cjs +1 -0
- package/stores.d.cts +1 -0
- package/stores.d.ts +1 -0
- package/stores.js +1 -0
- package/structured_query.cjs +1 -0
- package/structured_query.d.cts +1 -0
- package/structured_query.d.ts +1 -0
- package/structured_query.js +1 -0
- package/tools.cjs +1 -0
- package/tools.d.cts +1 -0
- package/tools.d.ts +1 -0
- package/tools.js +1 -0
- package/tracers/base.cjs +1 -0
- package/tracers/base.d.cts +1 -0
- package/tracers/base.d.ts +1 -0
- package/tracers/base.js +1 -0
- package/tracers/console.cjs +1 -0
- package/tracers/console.d.cts +1 -0
- package/tracers/console.d.ts +1 -0
- package/tracers/console.js +1 -0
- package/tracers/log_stream.cjs +1 -0
- package/tracers/log_stream.d.cts +1 -0
- package/tracers/log_stream.d.ts +1 -0
- package/tracers/log_stream.js +1 -0
- package/tracers/run_collector.cjs +1 -0
- package/tracers/run_collector.d.cts +1 -0
- package/tracers/run_collector.d.ts +1 -0
- package/tracers/run_collector.js +1 -0
- package/tracers/tracer_langchain.cjs +1 -0
- package/tracers/tracer_langchain.d.cts +1 -0
- package/tracers/tracer_langchain.d.ts +1 -0
- package/tracers/tracer_langchain.js +1 -0
- package/types/stream.cjs +1 -0
- package/types/stream.d.cts +1 -0
- package/types/stream.d.ts +1 -0
- package/types/stream.js +1 -0
- package/utils/async_caller.cjs +1 -0
- package/utils/async_caller.d.cts +1 -0
- package/utils/async_caller.d.ts +1 -0
- package/utils/async_caller.js +1 -0
- package/utils/chunk_array.cjs +1 -0
- package/utils/chunk_array.d.cts +1 -0
- package/utils/chunk_array.d.ts +1 -0
- package/utils/chunk_array.js +1 -0
- package/utils/env.cjs +1 -0
- package/utils/env.d.cts +1 -0
- package/utils/env.d.ts +1 -0
- package/utils/env.js +1 -0
- package/utils/event_source_parse.cjs +1 -0
- package/utils/event_source_parse.d.cts +1 -0
- package/utils/event_source_parse.d.ts +1 -0
- package/utils/event_source_parse.js +1 -0
- package/utils/format.cjs +1 -0
- package/utils/format.d.cts +1 -0
- package/utils/format.d.ts +1 -0
- package/utils/format.js +1 -0
- package/utils/function_calling.cjs +1 -0
- package/utils/function_calling.d.cts +1 -0
- package/utils/function_calling.d.ts +1 -0
- package/utils/function_calling.js +1 -0
- package/utils/hash.cjs +1 -0
- package/utils/hash.d.cts +1 -0
- package/utils/hash.d.ts +1 -0
- package/utils/hash.js +1 -0
- package/utils/json_patch.cjs +1 -0
- package/utils/json_patch.d.cts +1 -0
- package/utils/json_patch.d.ts +1 -0
- package/utils/json_patch.js +1 -0
- package/utils/json_schema.cjs +1 -0
- package/utils/json_schema.d.cts +1 -0
- package/utils/json_schema.d.ts +1 -0
- package/utils/json_schema.js +1 -0
- package/utils/math.cjs +1 -0
- package/utils/math.d.cts +1 -0
- package/utils/math.d.ts +1 -0
- package/utils/math.js +1 -0
- package/utils/stream.cjs +1 -0
- package/utils/stream.d.cts +1 -0
- package/utils/stream.d.ts +1 -0
- package/utils/stream.js +1 -0
- package/utils/testing.cjs +1 -0
- package/utils/testing.d.cts +1 -0
- package/utils/testing.d.ts +1 -0
- package/utils/testing.js +1 -0
- package/utils/tiktoken.cjs +1 -0
- package/utils/tiktoken.d.cts +1 -0
- package/utils/tiktoken.d.ts +1 -0
- package/utils/tiktoken.js +1 -0
- package/utils/types.cjs +1 -0
- package/utils/types.d.cts +1 -0
- package/utils/types.d.ts +1 -0
- package/utils/types.js +1 -0
- package/vectorstores.cjs +1 -0
- package/vectorstores.d.cts +1 -0
- package/vectorstores.d.ts +1 -0
- package/vectorstores.js +1 -0
- package/dist/agents.d.cts.map +0 -1
- package/dist/agents.d.ts.map +0 -1
- package/dist/caches/base.cjs.map +0 -1
- package/dist/caches/base.d.cts.map +0 -1
- package/dist/caches/base.d.ts.map +0 -1
- package/dist/caches/base.js.map +0 -1
- package/dist/callbacks/base.d.cts.map +0 -1
- package/dist/callbacks/base.d.ts.map +0 -1
- package/dist/callbacks/dispatch/index.d.cts.map +0 -1
- package/dist/callbacks/dispatch/index.d.ts.map +0 -1
- package/dist/callbacks/dispatch/web.d.cts.map +0 -1
- package/dist/callbacks/dispatch/web.d.ts.map +0 -1
- package/dist/callbacks/manager.d.cts.map +0 -1
- package/dist/callbacks/manager.d.ts.map +0 -1
- package/dist/chat_history.d.cts.map +0 -1
- package/dist/chat_history.d.ts.map +0 -1
- package/dist/context.d.cts.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/document_loaders/base.d.cts.map +0 -1
- package/dist/document_loaders/base.d.ts.map +0 -1
- package/dist/document_loaders/langsmith.d.cts.map +0 -1
- package/dist/document_loaders/langsmith.d.ts.map +0 -1
- package/dist/documents/document.d.cts.map +0 -1
- package/dist/documents/document.d.ts.map +0 -1
- package/dist/documents/transformers.d.cts.map +0 -1
- package/dist/documents/transformers.d.ts.map +0 -1
- package/dist/embeddings.d.cts.map +0 -1
- package/dist/embeddings.d.ts.map +0 -1
- package/dist/example_selectors/base.d.cts.map +0 -1
- package/dist/example_selectors/base.d.ts.map +0 -1
- package/dist/example_selectors/conditional.d.cts.map +0 -1
- package/dist/example_selectors/conditional.d.ts.map +0 -1
- package/dist/example_selectors/length_based.d.cts.map +0 -1
- package/dist/example_selectors/length_based.d.ts.map +0 -1
- package/dist/example_selectors/semantic_similarity.d.cts.map +0 -1
- package/dist/example_selectors/semantic_similarity.d.ts.map +0 -1
- package/dist/indexing/base.d.cts.map +0 -1
- package/dist/indexing/base.d.ts.map +0 -1
- package/dist/indexing/record_manager.d.cts.map +0 -1
- package/dist/indexing/record_manager.d.ts.map +0 -1
- package/dist/language_models/base.d.cts.map +0 -1
- package/dist/language_models/base.d.ts.map +0 -1
- package/dist/language_models/chat_models.d.cts.map +0 -1
- package/dist/language_models/chat_models.d.ts.map +0 -1
- package/dist/language_models/llms.d.cts.map +0 -1
- package/dist/language_models/llms.d.ts.map +0 -1
- package/dist/language_models/profile.d.cts.map +0 -1
- package/dist/language_models/profile.d.ts.map +0 -1
- package/dist/load/import_type.d.cts.map +0 -1
- package/dist/load/import_type.d.ts.map +0 -1
- package/dist/load/index.d.cts.map +0 -1
- package/dist/load/index.d.ts.map +0 -1
- package/dist/load/map_keys.d.cts.map +0 -1
- package/dist/load/map_keys.d.ts.map +0 -1
- package/dist/load/serializable.d.cts.map +0 -1
- package/dist/load/serializable.d.ts.map +0 -1
- package/dist/memory.d.cts.map +0 -1
- package/dist/memory.d.ts.map +0 -1
- package/dist/messages/ai.d.cts.map +0 -1
- package/dist/messages/ai.d.ts.map +0 -1
- package/dist/messages/base.d.cts.map +0 -1
- package/dist/messages/base.d.ts.map +0 -1
- package/dist/messages/chat.d.cts.map +0 -1
- package/dist/messages/chat.d.ts.map +0 -1
- package/dist/messages/content/base.d.cts.map +0 -1
- package/dist/messages/content/base.d.ts.map +0 -1
- package/dist/messages/content/data.d.cts.map +0 -1
- package/dist/messages/content/data.d.ts.map +0 -1
- package/dist/messages/content/index.d.cts.map +0 -1
- package/dist/messages/content/index.d.ts.map +0 -1
- package/dist/messages/content/multimodal.d.cts.map +0 -1
- package/dist/messages/content/multimodal.d.ts.map +0 -1
- package/dist/messages/content/tools.d.cts.map +0 -1
- package/dist/messages/content/tools.d.ts.map +0 -1
- package/dist/messages/format.d.cts.map +0 -1
- package/dist/messages/format.d.ts.map +0 -1
- package/dist/messages/function.d.cts.map +0 -1
- package/dist/messages/function.d.ts.map +0 -1
- package/dist/messages/human.d.cts.map +0 -1
- package/dist/messages/human.d.ts.map +0 -1
- package/dist/messages/message.d.cts.map +0 -1
- package/dist/messages/message.d.ts.map +0 -1
- package/dist/messages/metadata.d.cts.map +0 -1
- package/dist/messages/metadata.d.ts.map +0 -1
- package/dist/messages/modifier.d.cts.map +0 -1
- package/dist/messages/modifier.d.ts.map +0 -1
- package/dist/messages/system.d.cts.map +0 -1
- package/dist/messages/system.d.ts.map +0 -1
- package/dist/messages/tool.d.cts.map +0 -1
- package/dist/messages/tool.d.ts.map +0 -1
- package/dist/messages/transformers.d.cts.map +0 -1
- package/dist/messages/transformers.d.ts.map +0 -1
- package/dist/messages/utils.d.cts.map +0 -1
- package/dist/messages/utils.d.ts.map +0 -1
- package/dist/output_parsers/base.d.cts.map +0 -1
- package/dist/output_parsers/base.d.ts.map +0 -1
- package/dist/output_parsers/bytes.d.cts.map +0 -1
- package/dist/output_parsers/bytes.d.ts.map +0 -1
- package/dist/output_parsers/json.d.cts.map +0 -1
- package/dist/output_parsers/json.d.ts.map +0 -1
- package/dist/output_parsers/list.d.cts.map +0 -1
- package/dist/output_parsers/list.d.ts.map +0 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.cts.map +0 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +0 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts.map +0 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts.map +0 -1
- package/dist/output_parsers/string.d.cts.map +0 -1
- package/dist/output_parsers/string.d.ts.map +0 -1
- package/dist/output_parsers/structured.d.cts.map +0 -1
- package/dist/output_parsers/structured.d.ts.map +0 -1
- package/dist/output_parsers/transform.d.cts.map +0 -1
- package/dist/output_parsers/transform.d.ts.map +0 -1
- package/dist/output_parsers/xml.d.cts.map +0 -1
- package/dist/output_parsers/xml.d.ts.map +0 -1
- package/dist/outputs.d.cts.map +0 -1
- package/dist/outputs.d.ts.map +0 -1
- package/dist/prompt_values.d.cts.map +0 -1
- package/dist/prompt_values.d.ts.map +0 -1
- package/dist/prompts/base.d.cts.map +0 -1
- package/dist/prompts/base.d.ts.map +0 -1
- package/dist/prompts/chat.d.cts.map +0 -1
- package/dist/prompts/chat.d.ts.map +0 -1
- package/dist/prompts/dict.d.cts.map +0 -1
- package/dist/prompts/dict.d.ts.map +0 -1
- package/dist/prompts/few_shot.d.cts.map +0 -1
- package/dist/prompts/few_shot.d.ts.map +0 -1
- package/dist/prompts/image.d.cts.map +0 -1
- package/dist/prompts/image.d.ts.map +0 -1
- package/dist/prompts/pipeline.d.cts.map +0 -1
- package/dist/prompts/pipeline.d.ts.map +0 -1
- package/dist/prompts/prompt.d.cts.map +0 -1
- package/dist/prompts/prompt.d.ts.map +0 -1
- package/dist/prompts/serde.d.cts.map +0 -1
- package/dist/prompts/serde.d.ts.map +0 -1
- package/dist/prompts/string.d.cts.map +0 -1
- package/dist/prompts/string.d.ts.map +0 -1
- package/dist/prompts/structured.d.cts.map +0 -1
- package/dist/prompts/structured.d.ts.map +0 -1
- package/dist/prompts/template.d.cts.map +0 -1
- package/dist/prompts/template.d.ts.map +0 -1
- package/dist/retrievers/document_compressors/base.cjs.map +0 -1
- package/dist/retrievers/document_compressors/base.d.cts.map +0 -1
- package/dist/retrievers/document_compressors/base.d.ts.map +0 -1
- package/dist/retrievers/document_compressors/base.js +0 -17
- package/dist/retrievers/document_compressors/base.js.map +0 -1
- package/dist/retrievers/index.d.cts.map +0 -1
- package/dist/retrievers/index.d.ts.map +0 -1
- package/dist/runnables/base.d.cts.map +0 -1
- package/dist/runnables/base.d.ts.map +0 -1
- package/dist/runnables/branch.d.cts.map +0 -1
- package/dist/runnables/branch.d.ts.map +0 -1
- package/dist/runnables/config.d.cts.map +0 -1
- package/dist/runnables/config.d.ts.map +0 -1
- package/dist/runnables/graph.d.cts.map +0 -1
- package/dist/runnables/graph.d.ts.map +0 -1
- package/dist/runnables/history.d.cts.map +0 -1
- package/dist/runnables/history.d.ts.map +0 -1
- package/dist/runnables/passthrough.d.cts.map +0 -1
- package/dist/runnables/passthrough.d.ts.map +0 -1
- package/dist/runnables/router.d.cts.map +0 -1
- package/dist/runnables/router.d.ts.map +0 -1
- package/dist/runnables/types.d.cts.map +0 -1
- package/dist/runnables/types.d.ts.map +0 -1
- package/dist/singletons/async_local_storage/context.d.cts.map +0 -1
- package/dist/singletons/async_local_storage/context.d.ts.map +0 -1
- package/dist/singletons/async_local_storage/globals.d.cts.map +0 -1
- package/dist/singletons/async_local_storage/globals.d.ts.map +0 -1
- package/dist/singletons/async_local_storage/index.d.cts.map +0 -1
- package/dist/singletons/async_local_storage/index.d.ts.map +0 -1
- package/dist/singletons/callbacks.d.cts.map +0 -1
- package/dist/singletons/callbacks.d.ts.map +0 -1
- package/dist/stores.d.cts.map +0 -1
- package/dist/stores.d.ts.map +0 -1
- package/dist/structured_query/base.d.cts.map +0 -1
- package/dist/structured_query/base.d.ts.map +0 -1
- package/dist/structured_query/functional.d.cts.map +0 -1
- package/dist/structured_query/functional.d.ts.map +0 -1
- package/dist/structured_query/ir.d.cts.map +0 -1
- package/dist/structured_query/ir.d.ts.map +0 -1
- package/dist/structured_query/utils.d.cts.map +0 -1
- package/dist/structured_query/utils.d.ts.map +0 -1
- package/dist/tools/index.d.cts.map +0 -1
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/types.d.cts.map +0 -1
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/utils.d.cts.map +0 -1
- package/dist/tools/utils.d.ts.map +0 -1
- package/dist/tracers/base.d.cts.map +0 -1
- package/dist/tracers/base.d.ts.map +0 -1
- package/dist/tracers/console.d.cts.map +0 -1
- package/dist/tracers/console.d.ts.map +0 -1
- package/dist/tracers/event_stream.d.cts.map +0 -1
- package/dist/tracers/event_stream.d.ts.map +0 -1
- package/dist/tracers/log_stream.d.cts.map +0 -1
- package/dist/tracers/log_stream.d.ts.map +0 -1
- package/dist/tracers/run_collector.d.cts.map +0 -1
- package/dist/tracers/run_collector.d.ts.map +0 -1
- package/dist/tracers/tracer_langchain.d.cts.map +0 -1
- package/dist/tracers/tracer_langchain.d.ts.map +0 -1
- package/dist/types/_internal.d.cts.map +0 -1
- package/dist/types/_internal.d.ts.map +0 -1
- package/dist/types/type-utils.d.cts.map +0 -1
- package/dist/types/type-utils.d.ts.map +0 -1
- package/dist/utils/async_caller.d.cts.map +0 -1
- package/dist/utils/async_caller.d.ts.map +0 -1
- package/dist/utils/chunk_array.d.cts.map +0 -1
- package/dist/utils/chunk_array.d.ts.map +0 -1
- package/dist/utils/env.d.cts.map +0 -1
- package/dist/utils/env.d.ts.map +0 -1
- package/dist/utils/event_source_parse.d.cts.map +0 -1
- package/dist/utils/event_source_parse.d.ts.map +0 -1
- package/dist/utils/fast-json-patch/src/core.d.cts.map +0 -1
- package/dist/utils/fast-json-patch/src/core.d.ts.map +0 -1
- package/dist/utils/fast-json-patch/src/duplex.d.cts.map +0 -1
- package/dist/utils/fast-json-patch/src/duplex.d.ts.map +0 -1
- package/dist/utils/format.d.cts.map +0 -1
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/function_calling.d.cts.map +0 -1
- package/dist/utils/function_calling.d.ts.map +0 -1
- package/dist/utils/hash.d.cts.map +0 -1
- package/dist/utils/hash.d.ts.map +0 -1
- package/dist/utils/js-sha256/hash.d.cts.map +0 -1
- package/dist/utils/js-sha256/hash.d.ts.map +0 -1
- package/dist/utils/json.d.cts.map +0 -1
- package/dist/utils/json.d.ts.map +0 -1
- package/dist/utils/json_schema.d.cts.map +0 -1
- package/dist/utils/json_schema.d.ts.map +0 -1
- package/dist/utils/math.d.cts.map +0 -1
- package/dist/utils/math.d.ts.map +0 -1
- package/dist/utils/ml-distance/similarities.d.cts.map +0 -1
- package/dist/utils/ml-distance/similarities.d.ts.map +0 -1
- package/dist/utils/stream.d.cts.map +0 -1
- package/dist/utils/stream.d.ts.map +0 -1
- package/dist/utils/testing/chat_models.d.cts.map +0 -1
- package/dist/utils/testing/chat_models.d.ts.map +0 -1
- package/dist/utils/testing/embeddings.d.cts.map +0 -1
- package/dist/utils/testing/embeddings.d.ts.map +0 -1
- package/dist/utils/testing/llms.d.cts.map +0 -1
- package/dist/utils/testing/llms.d.ts.map +0 -1
- package/dist/utils/testing/message_history.d.cts.map +0 -1
- package/dist/utils/testing/message_history.d.ts.map +0 -1
- package/dist/utils/testing/output_parsers.d.cts.map +0 -1
- package/dist/utils/testing/output_parsers.d.ts.map +0 -1
- package/dist/utils/testing/retrievers.d.cts.map +0 -1
- package/dist/utils/testing/retrievers.d.ts.map +0 -1
- package/dist/utils/testing/runnables.d.cts.map +0 -1
- package/dist/utils/testing/runnables.d.ts.map +0 -1
- package/dist/utils/testing/tools.d.cts.map +0 -1
- package/dist/utils/testing/tools.d.ts.map +0 -1
- package/dist/utils/testing/tracers.d.cts.map +0 -1
- package/dist/utils/testing/tracers.d.ts.map +0 -1
- package/dist/utils/testing/vectorstores.d.cts.map +0 -1
- package/dist/utils/testing/vectorstores.d.ts.map +0 -1
- package/dist/utils/tiktoken.d.cts.map +0 -1
- package/dist/utils/tiktoken.d.ts.map +0 -1
- package/dist/utils/types/index.d.cts.map +0 -1
- package/dist/utils/types/index.d.ts.map +0 -1
- package/dist/utils/types/zod.d.cts.map +0 -1
- package/dist/utils/types/zod.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parseTypes.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.cts.map +0 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +0 -1
- package/dist/vectorstores.d.cts.map +0 -1
- package/dist/vectorstores.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":["Serializable","SerializedConstructor","ContentBlock","$InferMessageContent","$InferResponseMetadata","MessageStructure","MessageType","Message","MessageStringFormat","MESSAGE_SYMBOL","StoredMessageData","Record","StoredMessage","StoredGeneration","StoredMessageV1","MessageContent","Array","FunctionCall","BaseMessageFields","TStructure","TRole","Standard","OpenAIToolCall","Partial","mergeContent","_mergeStatus","BaseMessage","NonNullable","Symbol","toStringTag","isOpenAIToolCallArray","_mergeDicts","_mergeLists","Content","_mergeObj","T","BaseMessageChunk","MessageFieldWithRole","_isMessageFieldWithRole","BaseMessageLike","isBaseMessage","isBaseMessageChunk"],"sources":["../../src/messages/base.d.ts"],"sourcesContent":["import { Serializable, SerializedConstructor } from \"../load/serializable.js\";\nimport { ContentBlock } from \"./content/index.js\";\nimport { $InferMessageContent, $InferResponseMetadata, MessageStructure, MessageType, Message } from \"./message.js\";\nimport { type MessageStringFormat } from \"./format.js\";\n/** @internal */\ndeclare const MESSAGE_SYMBOL: unique symbol;\nexport interface StoredMessageData {\n content: string;\n role: string | undefined;\n name: string | undefined;\n tool_call_id: string | undefined;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n additional_kwargs?: Record<string, any>;\n /** Response metadata. For example: response headers, logprobs, token counts, model name. */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n response_metadata?: Record<string, any>;\n id?: string;\n}\nexport interface StoredMessage {\n type: string;\n data: StoredMessageData;\n}\nexport interface StoredGeneration {\n text: string;\n message?: StoredMessage;\n}\nexport interface StoredMessageV1 {\n type: string;\n role: string | undefined;\n text: string;\n}\nexport type MessageContent = string | Array<ContentBlock>;\nexport interface FunctionCall {\n /**\n * The arguments to call the function with, as generated by the model in JSON\n * format. Note that the model does not always generate valid JSON, and may\n * hallucinate parameters not defined by your function schema. Validate the\n * arguments in your code before calling your function.\n */\n arguments: string;\n /**\n * The name of the function to call.\n */\n name: string;\n}\nexport type BaseMessageFields<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> = {\n id?: string;\n name?: string;\n content?: $InferMessageContent<TStructure, TRole>;\n contentBlocks?: Array<ContentBlock.Standard>;\n /** @deprecated */\n additional_kwargs?: {\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n function_call?: FunctionCall;\n /**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\n tool_calls?: OpenAIToolCall[];\n [key: string]: unknown;\n };\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n};\nexport declare function mergeContent(firstContent: MessageContent, secondContent: MessageContent): MessageContent;\n/**\n * 'Merge' two statuses. If either value passed is 'error', it will return 'error'. Else\n * it will return 'success'.\n *\n * @param {\"success\" | \"error\" | undefined} left The existing value to 'merge' with the new value.\n * @param {\"success\" | \"error\" | undefined} right The new value to 'merge' with the existing value\n * @returns {\"success\" | \"error\"} The 'merged' value.\n */\nexport declare function _mergeStatus(left?: \"success\" | \"error\", right?: \"success\" | \"error\"): \"success\" | \"error\" | undefined;\n/**\n * Base class for all types of messages in a conversation. It includes\n * properties like `content`, `name`, and `additional_kwargs`. It also\n * includes methods like `toDict()` and `_getType()`.\n */\nexport declare abstract class BaseMessage<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends Serializable implements Message<TStructure, TRole> {\n lc_namespace: string[];\n lc_serializable: boolean;\n get lc_aliases(): Record<string, string>;\n readonly [MESSAGE_SYMBOL]: true;\n abstract readonly type: TRole;\n id?: string;\n name?: string;\n content: $InferMessageContent<TStructure, TRole>;\n additional_kwargs: NonNullable<BaseMessageFields<TStructure, TRole>[\"additional_kwargs\"]>;\n response_metadata: NonNullable<BaseMessageFields<TStructure, TRole>[\"response_metadata\"]>;\n /**\n * @deprecated Use .getType() instead or import the proper typeguard.\n * For example:\n *\n * ```ts\n * import { isAIMessage } from \"@langchain/core/messages\";\n *\n * const message = new AIMessage(\"Hello!\");\n * isAIMessage(message); // true\n * ```\n */\n _getType(): MessageType;\n /**\n * @deprecated Use .type instead\n * The type of the message.\n */\n getType(): MessageType;\n constructor(arg: $InferMessageContent<TStructure, TRole> | BaseMessageFields<TStructure, TRole>);\n /** Get text content of the message. */\n get text(): string;\n get contentBlocks(): Array<ContentBlock.Standard>;\n toDict(): StoredMessage;\n static lc_name(): string;\n // Can't be protected for silly reasons\n get _printableFields(): Record<string, unknown>;\n static isInstance(obj: unknown): obj is BaseMessage;\n // this private method is used to update the ID for the runtime\n // value as well as in lc_kwargs for serialisation\n _updateId(value: string | undefined): void;\n get [Symbol.toStringTag](): any;\n toFormattedString(format?: MessageStringFormat): string;\n}\n/**\n * @deprecated Use \"tool_calls\" field on AIMessages instead\n */\nexport type OpenAIToolCall = {\n /**\n * The ID of the tool call.\n */\n id: string;\n /**\n * The function that the model called.\n */\n function: FunctionCall;\n /**\n * The type of the tool. Currently, only `function` is supported.\n */\n type: \"function\";\n index?: number;\n};\nexport declare function isOpenAIToolCallArray(value?: unknown): value is OpenAIToolCall[];\nexport declare function _mergeDicts(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nleft?: Record<string, any>, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nright?: Record<string, any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n): Record<string, any>;\nexport declare function _mergeLists<Content extends ContentBlock>(left?: Content[], right?: Content[]): Content[] | undefined;\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport declare function _mergeObj<T = any>(left: T | undefined, right: T | undefined): T;\n/**\n * Represents a chunk of a message, which can be concatenated with other\n * message chunks. It includes a method `_merge_kwargs_dict()` for merging\n * additional keyword arguments from another `BaseMessageChunk` into this\n * one. It also overrides the `__add__()` method to support concatenation\n * of `BaseMessageChunk` instances.\n */\nexport declare abstract class BaseMessageChunk<TStructure extends MessageStructure = MessageStructure, TRole extends MessageType = MessageType> extends BaseMessage<TStructure, TRole> {\n abstract concat(chunk: BaseMessageChunk): BaseMessageChunk<TStructure, TRole>;\n static isInstance(obj: unknown): obj is BaseMessageChunk;\n}\nexport type MessageFieldWithRole = {\n role: MessageType;\n content: MessageContent;\n name?: string;\n} & Record<string, unknown>;\nexport declare function _isMessageFieldWithRole(x: BaseMessageLike): x is MessageFieldWithRole;\nexport type BaseMessageLike = BaseMessage | MessageFieldWithRole | [MessageType, MessageContent] | string\n/**\n * @deprecated Specifying \"type\" is deprecated and will be removed in 0.4.0.\n */\n | ({\n type: MessageType | \"user\" | \"assistant\" | \"placeholder\";\n} & BaseMessageFields & Record<string, unknown>) | SerializedConstructor;\n/**\n * @deprecated Use {@link BaseMessage.isInstance} instead\n */\nexport declare function isBaseMessage(messageLike?: unknown): messageLike is BaseMessage;\n/**\n * @deprecated Use {@link BaseMessageChunk.isInstance} instead\n */\nexport declare function isBaseMessageChunk(messageLike?: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V,CAAAA,MAAAA,CAAAA,EAtCzHlB,mBAsCyHkB,CAAAA,EAAAA,MAAAA;AAAW;AAInK;;;AAEaX,KAvCDO,cAAAA,GAuCCP;EAAc;AAEjB;AACV;EAA+C,EAAA,EAAA,MAAA;EAAA;;AAA+C;EAClFwB,QAAAA,EAnCEtB,YAmCa;EAAA;;;EAAqC,IAAIX,EAAAA,UAAAA;EAAW,KAAES,CAAAA,EAAAA,MAAAA;CAAc;AAM3FG,iBAlCoBY,qBAAAA,CAkCpBZ,KAAAA,CAAAA,EAAAA,OAAAA,CAAAA,EAAAA,KAAAA,IAlCqEI,cAkCrEJ,EAAAA;AAAoBP,iBAjCAoB,WAAAA;;AAiCgD,IAAA,CAAA,EA/BjEpB,MA+BiE,CAAA,MAAA,EAAA,GAAA,CAAA;AAIxE;AAIA,KAA0C,CAAlB8B,EArChB9B,MAqCgB8B,CAAAA,MAAAA,EAAAA,GAAkB;;GAnCvC9B;iBACqBqB,4BAA4B9B,qBAAqB+B,mBAAmBA,YAAYA;;iBAEhFC,yBAAyBC,sBAAsBA,gBAAgBA;;;;;;;;uBAQzDC,oCAAoC/B,mBAAmBA,gCAAgCC,cAAcA,qBAAqBoB,YAAYP,YAAYC;yBACrJgB,mBAAmBA,iBAAiBjB,YAAYC;0CAC/BgB;;KAEhCC,oBAAAA;QACF/B;WACGS;;IAETJ;iBACoB2B,uBAAAA,IAA2BC,uBAAuBF;KAC9DE,eAAAA,GAAkBb,cAAcW,wBAAwB/B,aAAaS;;;;QAKvET;IACNY,oBAAoBP,2BAA2BV;;;;iBAI3BuC,aAAAA,wCAAqDd;;;;iBAIrDe,kBAAAA,wCAA0DL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","ChatMessageFields","TStructure","ChatMessage","Record","ChatMessageChunk","isChatMessage","isChatMessageChunk"],"sources":["../../src/messages/chat.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface ChatMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"generic\"> {\n role: string;\n}\n/**\n * Represents a chat message in a conversation.\n */\nexport declare class ChatMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"generic\"> implements ChatMessageFields<TStructure> {\n static lc_name(): string;\n readonly type: \"generic\";\n role: string;\n static _chatMessageClass(): typeof ChatMessage;\n constructor(content: $InferMessageContent<TStructure, \"generic\">, role: string);\n constructor(fields: ChatMessageFields<TStructure>);\n static isInstance(obj: unknown): obj is ChatMessage;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * Represents a chunk of a chat message, which can be concatenated with\n * other chat message chunks.\n */\nexport declare class ChatMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"generic\"> {\n static lc_name(): string;\n readonly type: \"generic\";\n role: string;\n constructor(content: $InferMessageContent<TStructure, \"generic\">, role: string);\n constructor(fields: ChatMessageFields<TStructure>);\n concat(chunk: ChatMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is ChatMessageChunk;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * @deprecated Use {@link ChatMessage.isInstance} instead\n */\nexport declare function isChatMessage(x: BaseMessage): x is ChatMessage;\n/**\n * @deprecated Use {@link ChatMessageChunk.isInstance} instead\n */\nexport declare function isChatMessageChunk(x: BaseMessageChunk): x is ChatMessageChunk;\n"],"mappings":";;;;UAEiBK,qCAAqCD,mBAAmBA,0BAA0BF,kBAAkBI;;AAArH;;;;AAAqHA,cAMhGC,WANgGD,CAAAA,mBAMjEF,gBANiEE,GAM9CF,gBAN8CE,CAAAA,SAMpBN,WANoBM,CAMRA,UANQA,EAAAA,SAAAA,CAAAA,YAM0BD,iBAN1BC,CAM4CA,UAN5CA,CAAAA,CAAAA;EAAU,OAA5B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A,EAQiBL,WARjBK,CAAAA,EAAAA,CAAAA,IAQoCE,WARpCF;;;;AAGIG,iBASJG,kBAAAA,CATIH,CAAAA,EASkBP,gBATlBO,CAAAA,EAAAA,CAAAA,IAS0CC,gBAT1CD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","ChatMessageFields","TStructure","ChatMessage","Record","ChatMessageChunk","isChatMessage","isChatMessageChunk"],"sources":["../../src/messages/chat.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface ChatMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"generic\"> {\n role: string;\n}\n/**\n * Represents a chat message in a conversation.\n */\nexport declare class ChatMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"generic\"> implements ChatMessageFields<TStructure> {\n static lc_name(): string;\n readonly type: \"generic\";\n role: string;\n static _chatMessageClass(): typeof ChatMessage;\n constructor(content: $InferMessageContent<TStructure, \"generic\">, role: string);\n constructor(fields: ChatMessageFields<TStructure>);\n static isInstance(obj: unknown): obj is ChatMessage;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * Represents a chunk of a chat message, which can be concatenated with\n * other chat message chunks.\n */\nexport declare class ChatMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"generic\"> {\n static lc_name(): string;\n readonly type: \"generic\";\n role: string;\n constructor(content: $InferMessageContent<TStructure, \"generic\">, role: string);\n constructor(fields: ChatMessageFields<TStructure>);\n concat(chunk: ChatMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is ChatMessageChunk;\n get _printableFields(): Record<string, unknown>;\n}\n/**\n * @deprecated Use {@link ChatMessage.isInstance} instead\n */\nexport declare function isChatMessage(x: BaseMessage): x is ChatMess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;EAc3IG,WAAAA,CAAAA,MAAAA,EAKGJ,iBALa,CAKKC,UALL,CAAA;EAAA,MAAA,CAAA,KAAA,EAMnBG,gBANmB,CAMFH,UANE,CAAA,CAAA,EAAA,IAAA;EAAA,OAAoBF,UAAAA,CAAAA,GAAAA,EAAAA,OAAAA,CAAAA,EAAAA,GAAAA,IAObK,gBAPaL;EAAgB,IAAGA,gBAAAA,CAAAA,CAAAA,EAQhDI,MARgDJ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;;;;;AAKpDC,iBAQAK,aAAAA,CARAL,CAAAA,EAQiBL,WARjBK,CAAAA,EAAAA,CAAAA,IAQoCE,WARpCF;;;;AAGIG,iBASJG,kBAAAA,CATIH,CAAAA,EASkBP,gBATlBO,CAAAA,EAAAA,CAAAA,IAS0CC,gBAT1CD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.cts","names":["BaseContentBlock"],"sources":["../../../src/messages/content/base.d.ts"],"sourcesContent":["export interface BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: string;\n /**\n * Content block identifier, which can be either\n * - generated by the provider (e.g., a provider-specific ID)\n * - generated by LangChain upon creation (a uuid prefixed with 'lc-')\n */\n id?: string;\n /**\n * Arbitrary properties\n */\n [key: string]: unknown;\n}\n"],"mappings":";UAAiBA,gBAAAA;EAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":["BaseContentBlock"],"sources":["../../../src/messages/content/base.d.ts"],"sourcesContent":["export interface BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: string;\n /**\n * Content block identifier, which can be either\n * - generated by the provider (e.g., a provider-specific ID)\n * - generated by LangChain upon creation (a uuid prefixed with 'lc-')\n */\n id?: string;\n /**\n * Arbitrary properties\n */\n [key: string]: unknown;\n}\n"],"mappings":";UAAiBA,gBAAAA;EAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.cts","names":["BaseContentBlock","ImageDetail","MessageContentText","MessageContentImageUrl","MessageContentComplex","Record","Data","BaseDataContentBlock","URLContentBlock","Base64ContentBlock","PlainTextContentBlock","IDContentBlock","DataContentBlock","isDataContentBlock","isURLContentBlock","isBase64ContentBlock","isPlainTextContentBlock","isIDContentBlock","convertToOpenAIImageBlock","parseMimeType","parseBase64DataUrl","dataUrl","asTypedArray","Uint8Array","ProviderFormatTypes","TextFormat","ImageFormat","AudioFormat","FileFormat","VideoFormat","StandardContentBlockConverter","Partial","StandardImageBlock","Formats","StandardAudioBlock","StandardFileBlock","StandardTextBlock","convertToProviderContentBlock"],"sources":["../../../src/messages/content/data.d.ts"],"sourcesContent":["import { BaseContentBlock } from \"./base.js\";\n/**\n * @deprecated\n * Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type ImageDetail = \"auto\" | \"low\" | \"high\";\n/**\n * @deprecated\n * Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type MessageContentText = {\n type: \"text\";\n text: string;\n};\n/**\n * @deprecated\n * Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type MessageContentImageUrl = {\n type: \"image_url\";\n image_url: string | {\n url: string;\n detail?: ImageDetail;\n };\n};\n/**\n * @deprecated\n * Use {@link ContentBlock} instead.\n */\nexport type MessageContentComplex = MessageContentText | MessageContentImageUrl\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n | (Record<string, any> & {\n type?: \"text\" | \"image_url\" | string;\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n | (Record<string, any> & {\n type?: never;\n});\nexport type Data = never;\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace Data {\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface BaseDataContentBlock extends BaseContentBlock {\n mime_type?: string;\n metadata?: Record<string, unknown>;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface URLContentBlock extends BaseDataContentBlock {\n type: \"image\" | \"audio\" | \"file\";\n source_type: \"url\";\n url: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface Base64ContentBlock extends BaseDataContentBlock {\n type: \"image\" | \"audio\" | \"file\";\n source_type: \"base64\";\n data: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface PlainTextContentBlock extends BaseDataContentBlock {\n type: \"file\" | \"text\";\n source_type: \"text\";\n text: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface IDContentBlock extends BaseDataContentBlock {\n type: \"image\" | \"audio\" | \"file\";\n source_type: \"id\";\n id: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type DataContentBlock = URLContentBlock | Base64ContentBlock | PlainTextContentBlock | IDContentBlock;\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardImageBlock = (URLContentBlock | Base64ContentBlock | IDContentBlock) & {\n type: \"image\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardAudioBlock = (URLContentBlock | Base64ContentBlock | IDContentBlock) & {\n type: \"audio\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardFileBlock = (URLContentBlock | Base64ContentBlock | IDContentBlock | PlainTextContentBlock) & {\n type: \"file\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardTextBlock = PlainTextContentBlock & {\n type: \"text\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n type DataContentBlockType = DataContentBlock[\"type\"];\n}\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isDataContentBlock(content_block: object): content_block is Data.DataContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isURLContentBlock(content_block: object): content_block is Data.URLContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isBase64ContentBlock(content_block: object): content_block is Data.Base64ContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isPlainTextContentBlock(content_block: object): content_block is Data.PlainTextContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isIDContentBlock(content_block: object): content_block is Data.IDContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function convertToOpenAIImageBlock(content_block: Data.URLContentBlock | Data.Base64ContentBlock): {\n type: string;\n image_url: {\n url: string;\n };\n};\n/**\n * Utility function for ChatModelProviders. Parses a mime type into a type, subtype, and parameters.\n *\n * @param mime_type - The mime type to parse.\n * @returns An object containing the type, subtype, and parameters.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function parseMimeType(mime_type: string): {\n type: string;\n subtype: string;\n parameters: Record<string, string>;\n};\n/**\n * Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n *\n * @param dataUrl - The base64 data URL to parse.\n * @param asTypedArray - Whether to return the data as a typed array.\n * @returns An object containing the parsed data and mime type, or undefined if the data URL is invalid.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function parseBase64DataUrl({ dataUrl, asTypedArray }: {\n dataUrl: string;\n asTypedArray: true;\n}): {\n data: Uint8Array;\n mime_type: string;\n} | undefined;\n/**\n * Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n *\n * @param dataUrl - The base64 data URL to parse.\n * @param asTypedArray - Whether to return the data as a typed array.\n * @returns The parsed data and mime type, or undefined if the data URL is invalid.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function parseBase64DataUrl({ dataUrl, asTypedArray }: {\n dataUrl: string;\n asTypedArray?: false;\n}): {\n data: string;\n mime_type: string;\n} | undefined;\n/**\n * A bag of provider-specific content block types.\n *\n * Allows implementations of {@link StandardContentBlockConverter} and related to be defined only in\n * terms of the types they support. Also allows for forward compatibility as the set of known\n * standard types grows, as the set of types can be extended without breaking existing\n * implementations of the aforementioned interfaces.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type ProviderFormatTypes<TextFormat = unknown, ImageFormat = unknown, AudioFormat = unknown, FileFormat = unknown, VideoFormat = unknown> = {\n text: TextFormat;\n image: ImageFormat;\n audio: AudioFormat;\n file: FileFormat;\n video: VideoFormat;\n};\n/**\n * Utility interface for converting between standard and provider-specific data content blocks, to be\n * used when implementing chat model providers.\n *\n * Meant to be used with {@link convertToProviderContentBlock} and\n * {@link convertToStandardContentBlock} rather than being consumed directly.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport interface StandardContentBlockConverter<Formats extends Partial<ProviderFormatTypes>> {\n /**\n * The name of the provider type that corresponds to the provider-specific content block types\n * that this converter supports.\n */\n providerName: string;\n /**\n * Convert from a standard image block to a provider's proprietary image block format.\n * @param block - The standard image block to convert.\n * @returns The provider image block.\n */\n fromStandardImageBlock?(block: Data.StandardImageBlock): Formats[\"image\"];\n /**\n * Convert from a standard audio block to a provider's proprietary audio block format.\n * @param block - The standard audio block to convert.\n * @returns The provider audio block.\n */\n fromStandardAudioBlock?(block: Data.StandardAudioBlock): Formats[\"audio\"];\n /**\n * Convert from a standard file block to a provider's proprietary file block format.\n * @param block - The standard file block to convert.\n * @returns The provider file block.\n */\n fromStandardFileBlock?(block: Data.StandardFileBlock): Formats[\"file\"];\n /**\n * Convert from a standard text block to a provider's proprietary text block format.\n * @param block - The standard text block to convert.\n * @returns The provider text block.\n */\n fromStandardTextBlock?(block: Data.StandardTextBlock): Formats[\"text\"];\n}\n/**\n * Convert from a standard data content block to a provider's proprietary data content block format.\n *\n * Don't override this method. Instead, override the more specific conversion methods and use this\n * method unmodified.\n *\n * @param block - The standard data content block to convert.\n * @returns The provider data content block.\n * @throws An error if the standard data content block type is not supported.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function convertToProviderContentBlock<Formats extends Partial<ProviderFormatTypes>>(block: Data.DataContentBlock, converter: StandardContentBlockConverter<Formats>): Formats[keyof Formats];\n"],"mappings":";;;;;;AAKA;AAKA;AAQYG,KAbAF,WAAAA,GAaAE,MAAsB,GAAA,KAAA,GAIjBF,MAAAA;AAOjB;;;;AAEII,KArBQH,kBAAAA,GAqBRG;EAAM,IAINA,EAAAA,MAAAA;EAAM,IAAA,EAAA,MAAA;AAGV,CAAA;AAEA;;;;AAasCE,KAnC1BJ,sBAAAA,GAmC0BI;EAAoB,IASjBA,EAAAA,WAAAA;EAAoB,SASjBA,EAAAA,MAAAA,GAAAA;IASPA,GAAAA,EAAAA,MAAAA;IASTC,MAAAA,CAAAA,EAnEXP,WAmEWO;EAAe,CAAA;CAAqB;;;;;AAYjCA,KAxEnBJ,qBAAAA,GAAwBF,kBAwELM,GAxE0BL;;EAwEU,CAtE/DE,MAsEkEM,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAAAA;EAAc,IAOtDH,CAAAA,EAAAA,MAAAA,GAAAA,WAAAA,GAAAA,MAAAA;CAAe;;EAAsC,CAzE/EH,MAyEkFK,CAAAA,MAAAA,EAAAA,GAAAA,CAAAA,GAAAA;EAAqB,IAO9EA,CAAAA,EAAAA,KAAAA;CAAqB,CAAA;AAOF,KApFpCJ,IAAAA,GAoFoC,KAAA;AAKhD;AAIwBQ,kBA3FCR,IAAAA,CA2FgB;EAIjBS;AAIxB;AAIA;AAIA;EAAiD,UAAA,oBAAA,SAtGNf,gBAsGM,C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;;iBAIhEO,oBAAAA,0CAA8DT,IAAAA,CAAKG;;;;iBAInEO,uBAAAA,0CAAiEV,IAAAA,CAAKI;;;;iBAItEO,gBAAAA,0CAA0DX,IAAAA,CAAKK;;;;iBAI/DO,yBAAAA,gBAAyCZ,IAAAA,CAAKE,kBAAkBF,IAAAA,CAAKG;;;;;;;;;;;;;;iBAcrEU,aAAAA;;;cAGRd;;;;;;;;;;;iBAWQe,kBAAAA;;;;;;;QAIdG;;;;;;;;;;;;iBAYcH,kBAAAA;;;;;;;;;;;;;;;;;;;;KAiBZI;QACFC;SACCC;SACAC;QACDC;SACCC;;;;;;;;;;;UAWMC,8CAA8CC,QAAQP;;;;;;;;;;;iCAWpClB,IAAAA,CAAK0B,qBAAqBC;;;;;;iCAM1B3B,IAAAA,CAAK4B,qBAAqBD;;;;;;gCAM3B3B,IAAAA,CAAK6B,oBAAoBF;;;;;;gCAMzB3B,IAAAA,CAAK8B,oBAAoBH;;;;;;;;;;;;;;iBAcnCI,8CAA8CN,QAAQP,6BAA6BlB,IAAAA,CAAKM,6BAA6BkB,8BAA8BG,WAAWA,cAAcA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","names":["BaseContentBlock","ImageDetail","MessageContentText","MessageContentImageUrl","MessageContentComplex","Record","Data","BaseDataContentBlock","URLContentBlock","Base64ContentBlock","PlainTextContentBlock","IDContentBlock","DataContentBlock","isDataContentBlock","isURLContentBlock","isBase64ContentBlock","isPlainTextContentBlock","isIDContentBlock","convertToOpenAIImageBlock","parseMimeType","parseBase64DataUrl","dataUrl","asTypedArray","Uint8Array","ProviderFormatTypes","TextFormat","ImageFormat","AudioFormat","FileFormat","VideoFormat","StandardContentBlockConverter","Partial","StandardImageBlock","Formats","StandardAudioBlock","StandardFileBlock","StandardTextBlock","convertToProviderContentBlock"],"sources":["../../../src/messages/content/data.d.ts"],"sourcesContent":["import { BaseContentBlock } from \"./base.js\";\n/**\n * @deprecated\n * Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type ImageDetail = \"auto\" | \"low\" | \"high\";\n/**\n * @deprecated\n * Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type MessageContentText = {\n type: \"text\";\n text: string;\n};\n/**\n * @deprecated\n * Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type MessageContentImageUrl = {\n type: \"image_url\";\n image_url: string | {\n url: string;\n detail?: ImageDetail;\n };\n};\n/**\n * @deprecated\n * Use {@link ContentBlock} instead.\n */\nexport type MessageContentComplex = MessageContentText | MessageContentImageUrl\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n | (Record<string, any> & {\n type?: \"text\" | \"image_url\" | string;\n})\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n | (Record<string, any> & {\n type?: never;\n});\nexport type Data = never;\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace Data {\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface BaseDataContentBlock extends BaseContentBlock {\n mime_type?: string;\n metadata?: Record<string, unknown>;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface URLContentBlock extends BaseDataContentBlock {\n type: \"image\" | \"audio\" | \"file\";\n source_type: \"url\";\n url: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface Base64ContentBlock extends BaseDataContentBlock {\n type: \"image\" | \"audio\" | \"file\";\n source_type: \"base64\";\n data: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface PlainTextContentBlock extends BaseDataContentBlock {\n type: \"file\" | \"text\";\n source_type: \"text\";\n text: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n interface IDContentBlock extends BaseDataContentBlock {\n type: \"image\" | \"audio\" | \"file\";\n source_type: \"id\";\n id: string;\n }\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type DataContentBlock = URLContentBlock | Base64ContentBlock | PlainTextContentBlock | IDContentBlock;\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardImageBlock = (URLContentBlock | Base64ContentBlock | IDContentBlock) & {\n type: \"image\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardAudioBlock = (URLContentBlock | Base64ContentBlock | IDContentBlock) & {\n type: \"audio\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardFileBlock = (URLContentBlock | Base64ContentBlock | IDContentBlock | PlainTextContentBlock) & {\n type: \"file\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Standard} instead\n */\n type StandardTextBlock = PlainTextContentBlock & {\n type: \"text\";\n };\n /**\n * @deprecated\n * Use {@link ContentBlock.Multimodal.Data} instead\n */\n type DataContentBlockType = DataContentBlock[\"type\"];\n}\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isDataContentBlock(content_block: object): content_block is Data.DataContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isURLContentBlock(content_block: object): content_block is Data.URLContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isBase64ContentBlock(content_block: object): content_block is Data.Base64ContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isPlainTextContentBlock(content_block: object): content_block is Data.PlainTextContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function isIDContentBlock(content_block: object): content_block is Data.IDContentBlock;\n/**\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function convertToOpenAIImageBlock(content_block: Data.URLContentBlock | Data.Base64ContentBlock): {\n type: string;\n image_url: {\n url: string;\n };\n};\n/**\n * Utility function for ChatModelProviders. Parses a mime type into a type, subtype, and parameters.\n *\n * @param mime_type - The mime type to parse.\n * @returns An object containing the type, subtype, and parameters.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function parseMimeType(mime_type: string): {\n type: string;\n subtype: string;\n parameters: Record<string, string>;\n};\n/**\n * Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n *\n * @param dataUrl - The base64 data URL to parse.\n * @param asTypedArray - Whether to return the data as a typed array.\n * @returns An object containing the parsed data and mime type, or undefined if the data URL is invalid.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function parseBase64DataUrl({ dataUrl, asTypedArray }: {\n dataUrl: string;\n asTypedArray: true;\n}): {\n data: Uint8Array;\n mime_type: string;\n} | undefined;\n/**\n * Utility function for ChatModelProviders. Parses a base64 data URL into a typed array or string.\n *\n * @param dataUrl - The base64 data URL to parse.\n * @param asTypedArray - Whether to return the data as a typed array.\n * @returns The parsed data and mime type, or undefined if the data URL is invalid.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function parseBase64DataUrl({ dataUrl, asTypedArray }: {\n dataUrl: string;\n asTypedArray?: false;\n}): {\n data: string;\n mime_type: string;\n} | undefined;\n/**\n * A bag of provider-specific content block types.\n *\n * Allows implementations of {@link StandardContentBlockConverter} and related to be defined only in\n * terms of the types they support. Also allows for forward compatibility as the set of known\n * standard types grows, as the set of types can be extended without breaking existing\n * implementations of the aforementioned interfaces.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport type ProviderFormatTypes<TextFormat = unknown, ImageFormat = unknown, AudioFormat = unknown, FileFormat = unknown, VideoFormat = unknown> = {\n text: TextFormat;\n image: ImageFormat;\n audio: AudioFormat;\n file: FileFormat;\n video: VideoFormat;\n};\n/**\n * Utility interface for converting between standard and provider-specific data content blocks, to be\n * used when implementing chat model providers.\n *\n * Meant to be used with {@link convertToProviderContentBlock} and\n * {@link convertToStandardContentBlock} rather than being consumed directly.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport interface StandardContentBlockConverter<Formats extends Partial<ProviderFormatTypes>> {\n /**\n * The name of the provider type that corresponds to the provider-specific content block types\n * that this converter supports.\n */\n providerName: string;\n /**\n * Convert from a standard image block to a provider's proprietary image block format.\n * @param block - The standard image block to convert.\n * @returns The provider image block.\n */\n fromStandardImageBlock?(block: Data.StandardImageBlock): Formats[\"image\"];\n /**\n * Convert from a standard audio block to a provider's proprietary audio block format.\n * @param block - The standard audio block to convert.\n * @returns The provider audio block.\n */\n fromStandardAudioBlock?(block: Data.StandardAudioBlock): Formats[\"audio\"];\n /**\n * Convert from a standard file block to a provider's proprietary file block format.\n * @param block - The standard file block to convert.\n * @returns The provider file block.\n */\n fromStandardFileBlock?(block: Data.StandardFileBlock): Formats[\"file\"];\n /**\n * Convert from a standard text block to a provider's proprietary text block format.\n * @param block - The standard text block to convert.\n * @returns The provider text block.\n */\n fromStandardTextBlock?(block: Data.StandardTextBlock): Formats[\"text\"];\n}\n/**\n * Convert from a standard data content block to a provider's proprietary data content block format.\n *\n * Don't override this method. Instead, override the more specific conversion methods and use this\n * method unmodified.\n *\n * @param block - The standard data content block to convert.\n * @returns The provider data content block.\n * @throws An error if the standard data content block type is not supported.\n *\n * @deprecated Don't use data content blocks. Use {@link ContentBlock.Multimodal.Data} instead.\n */\nexport declare function convertToProviderContentBlock<Formats extends Partial<ProviderFormatTypes>>(block: Data.DataContentBlock, converter: StandardContentBlockConverter<Formats>): Formats[keyof Formats];\n"],"mappings":";;;;;;AAKA;AAKA;AAQYG,KAbAF,WAAAA,GAaAE,MAAsB,GAAA,KAAA,GAIjBF,MAAAA;AAOjB;;;;AAE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,IAAAA,CAAK4B,qBAAqBD;;;;;;gCAM3B3B,IAAAA,CAAK6B,oBAAoBF;;;;;;gCAMzB3B,IAAAA,CAAK8B,oBAAoBH;;;;;;;;;;;;;;iBAcnCI,8CAA8CN,QAAQP,6BAA6BlB,IAAAA,CAAKM,6BAA6BkB,8BAA8BG,WAAWA,cAAcA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":["BaseContentBlock","Tools","Multimodal","Data","ContentBlock","KNOWN_BLOCK_TYPES","Citation","Array","Record","TValue","Text","Reasoning","NonStandard","Standard"],"sources":["../../../src/messages/content/index.d.ts"],"sourcesContent":["import type { BaseContentBlock } from \"./base.js\";\nimport { type Tools } from \"./tools.js\";\nimport { type Multimodal } from \"./multimodal.js\";\nimport { type Data } from \"./data.js\";\nexport interface ContentBlock extends BaseContentBlock {\n}\nexport declare const KNOWN_BLOCK_TYPES: string[];\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace ContentBlock {\n /**\n * Annotation for citing data from a document.\n */\n export interface Citation {\n /**\n * Type of the content block\n */\n readonly type: \"citation\";\n /**\n * Source type for the citation.\n */\n source?: string;\n /**\n * URL of the document source\n */\n url?: string;\n /**\n * Source document title.\n *\n * For example, the page title for a web page or the title of a paper.\n */\n title?: string;\n /**\n * Start index of the **response text** for which the annotation applies.\n *\n * @see {Text}\n */\n startIndex?: number;\n /**\n * End index of the **response text** for which the annotation applies.\n *\n * @see {Text}\n */\n endIndex?: number;\n /**\n * Excerpt of source text being cited.\n */\n citedText?: string;\n }\n /**\n * Text output from a LLM.\n *\n * This typically represents the main text content of a message, such as the response\n * from a language model or the text of a user message.\n */\n export interface Text extends ContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"text\";\n /**\n * Block text.\n */\n text: string;\n /**\n * Index of block in aggregate response. Used during streaming.\n */\n index?: number;\n /**\n * Citations and other annotations.\n */\n annotations?: Array<Citation | BaseContentBlock>;\n }\n /**\n * Reasoning output from a LLM.\n */\n export interface Reasoning extends ContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"reasoning\";\n /**\n * Reasoning text.\n *\n * Either the thought summary or the raw reasoning text itself.\n * This is often parsed from `<think>` tags in the model's response.\n */\n reasoning: string;\n /**\n * Index of block in aggregate response. Used during streaming.\n */\n index?: number;\n }\n /**\n * Provider-specific content block.\n *\n * This is used to represent content blocks that are not part of the standard LangChain content model.\n * If a provider's non-standard output includes reasoning and tool calls, it should be\n * the adapter's job to parse that payload and emit the corresponding standard reasoning and tool call blocks.\n */\n export interface NonStandard<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TValue extends Record<string, any> = Record<string, any>> extends ContentBlock {\n /**\n * Type of the content block\n */\n type: \"non_standard\";\n /**\n * Provider-specific data\n */\n value: TValue;\n }\n export { Tools };\n export { Multimodal };\n export { Data };\n export type Standard = Text | Reasoning | NonStandard | Tools.Standard | Multimodal.Standard;\n}\n"],"mappings":";;;;;;UAIiBI,YAAAA,SAAqBJ;AAArBI,cAEIC,iBAFiBL,EAAAA,MAAAA,EAAgB;AAEtD;AAEyBI,kBAAAA,YAAAA,CAAY;EAAA;;;EA8DkB,OAAjCG,UAAAA,QAAAA,CAAAA;IAhBYH;;;IA+COI,SAAAA,IAAAA,EAAAA,UAAAA;IAQ1BC;;;IAGFP,MAAAA,CAAAA,EAAAA,MAAAA;IACAC;;;IACiCS,GAAAA,CAAAA,EAAAA,MAAAA;IAAcX;;AAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA5D9DG;;;;;;;;;;;;;;;;kBAgBZG,MAAMD,WAAWN;;;;;qCAKAI;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BpBI,sBAAsBA,6BAA6BJ;;;;;;;;WAQvDK;;WAEFR;WACAC;WACAC;yBACcO,OAAOC,YAAYC,cAAcX,KAAAA,CAAMY,WAAWX,UAAAA,CAAWW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["BaseContentBlock","Tools","Multimodal","Data","ContentBlock","KNOWN_BLOCK_TYPES","Citation","Array","Record","TValue","Text","Reasoning","NonStandard","Standard"],"sources":["../../../src/messages/content/index.d.ts"],"sourcesContent":["import type { BaseContentBlock } from \"./base.js\";\nimport { type Tools } from \"./tools.js\";\nimport { type Multimodal } from \"./multimodal.js\";\nimport { type Data } from \"./data.js\";\nexport interface ContentBlock extends BaseContentBlock {\n}\nexport declare const KNOWN_BLOCK_TYPES: string[];\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace ContentBlock {\n /**\n * Annotation for citing data from a document.\n */\n export interface Citation {\n /**\n * Type of the content block\n */\n readonly type: \"citation\";\n /**\n * Source type for the citation.\n */\n source?: string;\n /**\n * URL of the document source\n */\n url?: string;\n /**\n * Source document title.\n *\n * For example, the page title for a web page or the title of a paper.\n */\n title?: string;\n /**\n * Start index of the **response text** for which the annotation applies.\n *\n * @see {Text}\n */\n startIndex?: number;\n /**\n * End index of the **response text** for which the annotation applies.\n *\n * @see {Text}\n */\n endIndex?: number;\n /**\n * Excerpt of source text being cited.\n */\n citedText?: string;\n }\n /**\n * Text output from a LLM.\n *\n * This typically represents the main text content of a message, such as the response\n * from a language model or the text of a user message.\n */\n export interface Text extends ContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"text\";\n /**\n * Block text.\n */\n text: string;\n /**\n * Index of block in aggregate response. Used during streaming.\n */\n index?: number;\n /**\n * Citations and other annotations.\n */\n annotations?: Array<Citation | BaseContentBlock>;\n }\n /**\n * Reasoning output from a LLM.\n */\n export interface Reasoning extends ContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"reasoning\";\n /**\n * Reasoning text.\n *\n * Either the thought summary or the raw reasoning text itself.\n * This is often parsed from `<think>` tags in the model's response.\n */\n reasoning: string;\n /**\n * Index of block in aggregate response. Used during streaming.\n */\n index?: number;\n }\n /**\n * Provider-specific content block.\n *\n * This is used to represent content blocks that are not part of the standard LangChain content model.\n * If a provider's non-standard output includes reasoning and tool calls, it should be\n * the adapter's job to parse that payload and emit the corresponding standard reasoning and tool call blocks.\n */\n export interface NonStandard<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n TValue extends Record<string, any> = Record<string, any>> extends ContentBlock {\n /**\n * Type of the content block\n */\n type: \"non_standard\";\n /**\n * Provider-specific data\n */\n value: TValue;\n }\n export { Tools };\n export { Multimodal };\n export { Data };\n export type Standard = Text | Reasoning | NonStandard | Tools.Standard | Multimodal.Standard;\n}\n"],"mappings":";;;;;;UAIiBI,YAAAA,SAAqBJ;AAArBI,cAEIC,iBAFiBL,EAAAA,MAAAA,EAAgB;AAEtD;AAEyBI,kBAAAA,YAAAA,CAAY;EAAA;;;EA8DkB,OAAjCG,UAAAA,QAAAA,CAAAA;IAhBYH;;;IA+COI,SAAAA,IAAAA,EAAAA,UAAAA;IAQ1BC;;;IAGFP,MAAAA,CAAAA,EAAAA,MAAAA;IACAC;;;IACiCS,GAAAA,CAAAA,EAAAA,MAAAA;IAAcX;;AAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA5D9DG;;;;;;;;;;;;;;;;kBAgBZG,MAAMD,WAAWN;;;;;qCAKAI;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BpBI,sBAAsBA,6BAA6BJ;;;;;;;;WAQvDK;;WAEFR;WACAC;WACAC;yBACcO,OAAOC,YAAYC,cAAcX,KAAAA,CAAMY,WAAWX,UAAAA,CAAWW"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multimodal.d.cts","names":["BaseContentBlock","Multimodal","KNOWN_BLOCK_TYPES","BaseDataRecord","Uint8Array","DataRecordFileId","DataRecordUrl","DataRecordBase64","Record","DataRecord","TMetadata","Data","Image","Video","Audio","PlainText","File"],"sources":["../../../src/messages/content/multimodal.d.ts"],"sourcesContent":["import { BaseContentBlock } from \"./base.js\";\nexport type Multimodal = never;\nexport declare const KNOWN_BLOCK_TYPES: string[];\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace Multimodal {\n type BaseDataRecord = {\n /**\n * MIME type of the file.\n *\n * @see https://www.iana.org/assignments/media-types/media-types.xhtml#image\n */\n mimeType?: string | undefined;\n };\n type DataRecordFileId = BaseDataRecord & {\n /**\n * ID of the data file, e.g. from a provider's file api\n */\n fileId: string;\n url?: never;\n data?: never;\n };\n type DataRecordUrl = BaseDataRecord & {\n fileId?: never;\n /**\n * URL of the data file\n */\n url: string;\n data?: never;\n };\n type DataRecordBase64 = BaseDataRecord & {\n fileId?: never;\n url?: never;\n /**\n * MIME type of the file. Required for base64 encoding.\n *\n * @see https://www.iana.org/assignments/media-types/media-types.xhtml#image\n */\n mimeType: string;\n /**\n * Base64 encoded string or binary data of the data\n */\n data: string | Uint8Array;\n };\n type DataRecord = DataRecordFileId | DataRecordUrl | DataRecordBase64;\n /** Content block for multimodal data */\n type Data<TMetadata = Record<string, unknown>> = BaseContentBlock & DataRecord & {\n /**\n * MIME type of the file. Required for base64 encoding.\n */\n mimeType?: string;\n /**\n * Metadata of the file\n */\n metadata?: TMetadata;\n /**\n * Content block identifier for multimodal content, e.g. image, video, audio, file or plain text. This can be either:\n * - generated by the provider (e.g., an OpenAI block ID)\n * - generated by LangChain upon creation\n */\n id?: string;\n };\n /** Content block for image data */\n type Image = Data & {\n /** Type of the content block */\n readonly type: \"image\";\n };\n /** Content block for video data */\n type Video = Data & {\n /** Type of the content block */\n readonly type: \"video\";\n };\n /** Content block for audio data */\n type Audio = Data & {\n /** Type of the content block */\n readonly type: \"audio\";\n };\n /** Content block for plain text data */\n type PlainText = Data & {\n /** Type of the content block */\n readonly type: \"text-plain\";\n /**\n * Plaintext content. This is optional if the data is base64 encoded.\n */\n text?: string;\n /**\n * Title of the file, e.g. the title of a document\n */\n title?: string;\n /**\n * Context for the text, e.g. a description or a summary of the text's content\n */\n context?: string;\n };\n /** Content block for file data */\n type File = Data & {\n /**\n * Non-descript multimodal content block\n *\n * This block is intended for files that aren't covered by existing content block types.\n */\n readonly type: \"file\";\n };\n type Standard = Image | Video | Audio | PlainText | File;\n}\n"],"mappings":";;;KACYC,UAAAA;AAAZ;AAGyBA,kBAAAA,UAAAA,CAAU;EAAA,KAAA,cAAA,GAAA;IASPE;;;;;IA8BaG,QAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAa,CAAA;EAAmB,KAE/CE,gBAAAA,GAhCEL,cAgCFK,GAAAA;IAA2BR;;;IAiBpCW,MAAAA,EAAAA,MAAAA;IAKAA,GAAAA,CAAAA,EAAAA,KAAAA;IAKAA,IAAAA,CAAAA,EAAAA,KAAAA;EAAI,CAAA;EAKI,KAiBTA,aAAAA,GAzESR,cAyETQ,GAAAA;IAQIC,MAAAA,CAAAA,EAAAA,KAAAA;IAAQC;;;IAA4BG,GAAAA,EAAAA,MAAAA;IAAI,IAAA,CAAA,EAAA,KAAA;;0BAzEhCb;;;;;;;;;;;;mBAYLC;;oBAEDC,mBAAmBC,gBAAgBC;;wBAE/BC,2BAA2BR,mBAAmBS;;;;;;;;eAQrDC;;;;;;;;;eASFC;;;;;eAKAA;;;;;eAKAA;;;;;mBAKIA;;;;;;;;;;;;;;;;;cAiBLA;;;;;;;;kBAQIC,QAAQC,QAAQC,QAAQC,YAAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multimodal.d.ts","names":["BaseContentBlock","Multimodal","KNOWN_BLOCK_TYPES","BaseDataRecord","Uint8Array","DataRecordFileId","DataRecordUrl","DataRecordBase64","Record","DataRecord","TMetadata","Data","Image","Video","Audio","PlainText","File"],"sources":["../../../src/messages/content/multimodal.d.ts"],"sourcesContent":["import { BaseContentBlock } from \"./base.js\";\nexport type Multimodal = never;\nexport declare const KNOWN_BLOCK_TYPES: string[];\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace Multimodal {\n type BaseDataRecord = {\n /**\n * MIME type of the file.\n *\n * @see https://www.iana.org/assignments/media-types/media-types.xhtml#image\n */\n mimeType?: string | undefined;\n };\n type DataRecordFileId = BaseDataRecord & {\n /**\n * ID of the data file, e.g. from a provider's file api\n */\n fileId: string;\n url?: never;\n data?: never;\n };\n type DataRecordUrl = BaseDataRecord & {\n fileId?: never;\n /**\n * URL of the data file\n */\n url: string;\n data?: never;\n };\n type DataRecordBase64 = BaseDataRecord & {\n fileId?: never;\n url?: never;\n /**\n * MIME type of the file. Required for base64 encoding.\n *\n * @see https://www.iana.org/assignments/media-types/media-types.xhtml#image\n */\n mimeType: string;\n /**\n * Base64 encoded string or binary data of the data\n */\n data: string | Uint8Array;\n };\n type DataRecord = DataRecordFileId | DataRecordUrl | DataRecordBase64;\n /** Content block for multimodal data */\n type Data<TMetadata = Record<string, unknown>> = BaseContentBlock & DataRecord & {\n /**\n * MIME type of the file. Required for base64 encoding.\n */\n mimeType?: string;\n /**\n * Metadata of the file\n */\n metadata?: TMetadata;\n /**\n * Content block identifier for multimodal content, e.g. image, video, audio, file or plain text. This can be either:\n * - generated by the provider (e.g., an OpenAI block ID)\n * - generated by LangChain upon creation\n */\n id?: string;\n };\n /** Content block for image data */\n type Image = Data & {\n /** Type of the content block */\n readonly type: \"image\";\n };\n /** Content block for video data */\n type Video = Data & {\n /** Type of the content block */\n readonly type: \"video\";\n };\n /** Content block for audio data */\n type Audio = Data & {\n /** Type of the content block */\n readonly type: \"audio\";\n };\n /** Content block for plain text data */\n type PlainText = Data & {\n /** Type of the content block */\n readonly type: \"text-plain\";\n /**\n * Plaintext content. This is optional if the data is base64 encoded.\n */\n text?: string;\n /**\n * Title of the file, e.g. the title of a document\n */\n title?: string;\n /**\n * Context for the text, e.g. a description or a summary of the text's content\n */\n context?: string;\n };\n /** Content block for file data */\n type File = Data & {\n /**\n * Non-descript multimodal content block\n *\n * This block is intended for files that aren't covered by existing content block types.\n */\n readonly type: \"file\";\n };\n type Standard = Image | Video | Audio | PlainText | File;\n}\n"],"mappings":";;;KACYC,UAAAA;AAAZ;AAGyBA,kBAAAA,UAAAA,CAAU;EAAA,KAAA,cAAA,GAAA;IASPE;;;;;IA8BaG,QAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAa,CAAA;EAAmB,KAE/CE,gBAAAA,GAhCEL,cAgCFK,GAAAA;IAA2BR;;;IAiBpCW,MAAAA,EAAAA,MAAAA;IAKAA,GAAAA,CAAAA,EAAAA,KAAAA;IAKAA,IAAAA,CAAAA,EAAAA,KAAAA;EAAI,CAAA;EAKI,KAiBTA,aAAAA,GAzESR,cAyETQ,GAAAA;IAQIC,MAAAA,CAAAA,EAAAA,KAAAA;IAAQC;;;IAA4BG,GAAAA,EAAAA,MAAAA;IAAI,IAAA,CAAA,EAAA,KAAA;;0BAzEhCb;;;;;;;;;;;;mBAYLC;;oBAEDC,mBAAmBC,gBAAgBC;;wBAE/BC,2BAA2BR,mBAAmBS;;;;;;;;eAQrDC;;;;;;;;;eASFC;;;;;eAKAA;;;;;eAKAA;;;;;mBAKIA;;;;;;;;;;;;;;;;;cAiBLA;;;;;;;;kBAQIC,QAAQC,QAAQC,QAAQC,YAAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.cts","names":["BaseContentBlock","Tools","KNOWN_BLOCK_TYPES","TName","TArgs","Record","TOutput","ToolCall","ToolCallChunk","InvalidToolCall","ServerToolCall","ServerToolCallChunk","ServerToolCallResult"],"sources":["../../../src/messages/content/tools.d.ts"],"sourcesContent":["import { BaseContentBlock } from \"./base.js\";\nexport type Tools = never;\nexport declare const KNOWN_BLOCK_TYPES: string[];\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace Tools {\n /**\n * Represents a request to call a tool.\n *\n * @example\n * ```ts\n * const toolCall: ToolCall = {\n * type: \"tool_call\",\n * name: \"foo\",\n * args: { a: 1 },\n * callId: \"123\"\n * };\n * ```\n * This represents a request to call the tool named \"foo\" with arguments {\"a\": 1}\n * and an identifier of \"123\".\n */\n interface ToolCall<TName extends string = string, TArgs = unknown> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"tool_call\";\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 /** Content block to represent partial data of a tool call */\n interface ToolCallChunk<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"tool_call_chunk\";\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 * The index of the tool call chunk\n */\n index?: number;\n }\n /** Content block to represent an invalid tool call */\n interface InvalidToolCall<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"invalid_tool_call\";\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 }\n interface ServerToolCall<TName extends string = string, TArgs = unknown> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call\";\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 interface ServerToolCallChunk<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call_chunk\";\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 interface ServerToolCallResult<TOutput = Record<string, unknown>> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call_result\";\n /**\n * The unique identifier of the tool call that this result corresponds to\n */\n toolCallId: string;\n /**\n * The status of the server tool call\n */\n status: \"success\" | \"error\";\n /**\n * The output of the server tool call\n */\n output: TOutput;\n }\n type Standard = ToolCall | ToolCallChunk | InvalidToolCall | ServerToolCall | ServerToolCallChunk | ServerToolCallResult;\n}\n"],"mappings":";;;KACYC,KAAAA;AAAZ;AAGyBA,kBAAAA,KAAAA,CAAK;EAAA;;;;;;;;;;;;;;;EAoHP,UAhBuDD,QAAAA,CAAAA,cAAAA,MAAAA,GAAAA,MAAAA,EAAAA,QAAAA,OAAAA,CAAAA,SApFCA,gBAoFDA,CAAAA;IAkB1DO;;;IAA6CG,SAAAA,IAAAA,EAAAA,WAAAA;IAAiBC;;AAA0C;UA9F9GR;;;;UAIAC;;;iEAGqDJ;;;;;;;;WAQpDG;;;;;;;;;;;mEAWsDH;;;;;;;;WAQtDG;;;;;;;;;;;;;;mFAcsEH;;;;;;;;UAQvEG;;;;UAIAC;;uEAE2DJ;;;;;;;;WAQ1DG;;;;;;2CAM8BE,iCAAiCL;;;;;;;;;;;;;;;;YAgB9DM;;kBAEIC,WAAWC,gBAAgBC,kBAAkBC,iBAAiBC,sBAAsBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","names":["BaseContentBlock","Tools","KNOWN_BLOCK_TYPES","TName","TArgs","Record","TOutput","ToolCall","ToolCallChunk","InvalidToolCall","ServerToolCall","ServerToolCallChunk","ServerToolCallResult"],"sources":["../../../src/messages/content/tools.d.ts"],"sourcesContent":["import { BaseContentBlock } from \"./base.js\";\nexport type Tools = never;\nexport declare const KNOWN_BLOCK_TYPES: string[];\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport declare namespace Tools {\n /**\n * Represents a request to call a tool.\n *\n * @example\n * ```ts\n * const toolCall: ToolCall = {\n * type: \"tool_call\",\n * name: \"foo\",\n * args: { a: 1 },\n * callId: \"123\"\n * };\n * ```\n * This represents a request to call the tool named \"foo\" with arguments {\"a\": 1}\n * and an identifier of \"123\".\n */\n interface ToolCall<TName extends string = string, TArgs = unknown> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"tool_call\";\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 /** Content block to represent partial data of a tool call */\n interface ToolCallChunk<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"tool_call_chunk\";\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 * The index of the tool call chunk\n */\n index?: number;\n }\n /** Content block to represent an invalid tool call */\n interface InvalidToolCall<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"invalid_tool_call\";\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 }\n interface ServerToolCall<TName extends string = string, TArgs = unknown> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call\";\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 interface ServerToolCallChunk<TName extends string = string> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call_chunk\";\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 interface ServerToolCallResult<TOutput = Record<string, unknown>> extends BaseContentBlock {\n /**\n * Type of the content block\n */\n readonly type: \"server_tool_call_result\";\n /**\n * The unique identifier of the tool call that this result corresponds to\n */\n toolCallId: string;\n /**\n * The status of the server tool call\n */\n status: \"success\" | \"error\";\n /**\n * The output of the server tool call\n */\n output: TOutput;\n }\n type Standard = ToolCall | ToolCallChunk | InvalidToolCall | ServerToolCall | ServerToolCallChunk | ServerToolCallResult;\n}\n"],"mappings":";;;KACYC,KAAAA;AAAZ;AAGyBA,kBAAAA,KAAAA,CAAK;EAAA;;;;;;;;;;;;;;;EAoHP,UAhBuDD,QAAAA,CAAAA,cAAAA,MAAAA,GAAAA,MAAAA,EAAAA,QAAAA,OAAAA,CAAAA,SApFCA,gBAoFDA,CAAAA;IAkB1DO;;;IAA6CG,SAAAA,IAAAA,EAAAA,WAAAA;IAAiBC;;AAA0C;UA9F9GR;;;;UAIAC;;;iEAGqDJ;;;;;;;;WAQpDG;;;;;;;;;;;mEAWsDH;;;;;;;;WAQtDG;;;;;;;;;;;;;;mFAcsEH;;;;;;;;UAQvEG;;;;UAIAC;;uEAE2DJ;;;;;;;;WAQ1DG;;;;;;2CAM8BE,iCAAiCL;;;;;;;;;;;;;;;;YAgB9DM;;kBAEIC,WAAWC,gBAAgBC,kBAAkBC,iBAAiBC,sBAAsBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.cts","names":["BaseMessage","MessageStringFormat","convertToFormattedString"],"sources":["../../src/messages/format.d.ts"],"sourcesContent":["import { type BaseMessage } from \"./base.js\";\nexport type MessageStringFormat = \"pretty\";\nexport declare function convertToFormattedString(message: BaseMessage, format?: MessageStringFormat): string;\n"],"mappings":";AACYC,KAAAA,mBAAAA,GAAmB,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","names":["BaseMessage","MessageStringFormat","convertToFormattedString"],"sources":["../../src/messages/format.d.ts"],"sourcesContent":["import { type BaseMessage } from \"./base.js\";\nexport type MessageStringFormat = \"pretty\";\nexport declare function convertToFormattedString(message: BaseMessage, format?: MessageStringFormat): string;\n"],"mappings":";AACYC,KAAAA,mBAAAA,GAAmB,QAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","MessageStructure","FunctionMessageFields","TStructure","FunctionMessage","FunctionMessageChunk","isFunctionMessage","isFunctionMessageChunk"],"sources":["../../src/messages/function.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { MessageStructure } from \"./message.js\";\nexport interface FunctionMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"function\"> {\n name: string;\n}\n/**\n * Represents a function message in a conversation.\n */\nexport declare class FunctionMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"function\"> implements FunctionMessageFields<TStructure> {\n static lc_name(): string;\n readonly type: \"function\";\n name: string;\n constructor(fields: FunctionMessageFields<TStructure>);\n}\n/**\n * Represents a chunk of a function message, which can be concatenated\n * with other function message chunks.\n */\nexport declare class FunctionMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"function\"> {\n static lc_name(): string;\n readonly type: \"function\";\n concat(chunk: FunctionMessageChunk<TStructure>): this;\n}\nexport declare function isFunctionMessage(x: BaseMessage): x is FunctionMessage;\nexport declare function isFunctionMessageChunk(x: BaseMessageChunk): x is FunctionMessageChunk;\n"],"mappings":";;;;UAEiBI,yCAAyCD,mBAAmBA,0BAA0BD,kBAAkBG;;AAAzH;;;;AAAyHA,cAMpGC,eANoGD,CAAAA,mBAMjEF,gBANiEE,GAM9CF,gBAN8CE,CAAAA,SAMpBL,WANoBK,CAMRA,UANQA,EAAAA,UAAAA,CAAAA,YAM2BD,qBAN3BC,CAMiDA,UANjDA,CAAAA,CAAAA;EAAU,OAA5BH,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAiB,SAAA,IAAA,EAAA,UAAA;EAMnGI,IAAAA,EAAAA,MAAAA;EAAe,WAAA,CAAA,MAAA,EAIZF,qBAJY,CAIUC,UAJV,CAAA;;;;;;AAIZD,cAMHG,oBANGH,CAAAA,mBAMqCD,gBANrCC,GAMwDD,gBANxDC,CAAAA,SAMkFH,gBANlFG,CAMmGC,UANnGD,EAAAA,UAAAA,CAAAA,CAAAA;EAAqB,OAJwDJ,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAW,SAAoCI,IAAAA,EAAAA,UAAAA;EAAqB,MAAA,CAAA,KAAA,EAavJG,oBAbuJ,CAalIF,UAbkI,CAAA,CAAA,EAAA,IAAA;AAUzK;AAAyC,iBAKjBG,iBAAAA,CALiB,CAAA,EAKIR,WALJ,CAAA,EAAA,CAAA,IAKuBM,eALvB;AAAoBH,iBAMrCM,sBAAAA,CANqCN,CAAAA,EAMXF,gBANWE,CAAAA,EAAAA,CAAAA,IAMaI,oBANbJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"function.d.ts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","MessageStructure","FunctionMessageFields","TStructure","FunctionMessage","FunctionMessageChunk","isFunctionMessage","isFunctionMessageChunk"],"sources":["../../src/messages/function.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport { MessageStructure } from \"./message.js\";\nexport interface FunctionMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"function\"> {\n name: string;\n}\n/**\n * Represents a function message in a conversation.\n */\nexport declare class FunctionMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"function\"> implements FunctionMessageFields<TStructure> {\n static lc_name(): string;\n readonly type: \"function\";\n name: string;\n constructor(fields: FunctionMessageFields<TStructure>);\n}\n/**\n * Represents a chunk of a function message, which can be concatenated\n * with other function message chunks.\n */\nexport declare class FunctionMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"function\"> {\n static lc_name(): string;\n readonly type: \"function\";\n concat(chunk: FunctionMessageChunk<TStructure>): this;\n}\nexport declare function isFunctionMessage(x: BaseMessage): x is FunctionMessage;\nexport declare function isFunctionMessageChunk(x: BaseMessageChunk): x is FunctionMessageChunk;\n"],"mappings":";;;;UAEiBI,yCAAyCD,mBAAmBA,0BAA0BD,kBAAkBG;;AAAzH;;;;AAAyHA,cAMpGC,eANoGD,CAAAA,mBAMjEF,gBANiEE,GAM9CF,gBAN8CE,CAAAA,SAMpBL,WANoBK,CAMRA,UANQA,EAAAA,UAAAA,CAAAA,YAM2BD,qBAN3BC,CAMiDA,UANjDA,CAAAA,CAAAA;EAAU,OAA5BH,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAiB,SAAA,IAAA,EAAA,UAAA;EAMnGI,IAAAA,EAAAA,MAAAA;EAAe,WAAA,CAAA,MAAA,EAIZF,qBAJY,CAIUC,UAJV,CAAA;;;;;;AAIZD,cAMHG,oBANGH,CAAAA,mBAMqCD,gBANrCC,GAMwDD,gBANxDC,CAAAA,SAMkFH,gBANlFG,CAMmGC,UANnGD,EAAAA,UAAAA,CAAAA,CAAAA;EAAqB,OAJwDJ,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAW,SAAoCI,IAAAA,EAAAA,UAAAA;EAAqB,MAAA,CAAA,KAAA,EAavJG,oBAbuJ,CAalIF,UAbkI,CAAA,CAAA,EAAA,IAAA;AAUzK;AAAyC,iBAKjBG,iBAAAA,CALiB,CAAA,EAKIR,WALJ,CAAA,EAAA,CAAA,IAKuBM,eALvB;AAAoBH,iBAMrCM,sBAAAA,CANqCN,CAAAA,EAMXF,gBANWE,CAAAA,EAAAA,CAAAA,IAMaI,oBANbJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"human.d.cts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","HumanMessageFields","TStructure","HumanMessage","HumanMessageChunk","isHumanMessage","isHumanMessageChunk"],"sources":["../../src/messages/human.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport type { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface HumanMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"human\"> {\n}\n/**\n * Represents a human message in a conversation.\n */\nexport declare class HumanMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"human\"> {\n static lc_name(): string;\n readonly type: \"human\";\n constructor(fields: $InferMessageContent<TStructure, \"human\"> | HumanMessageFields<TStructure>);\n static isInstance(obj: unknown): obj is HumanMessage;\n}\n/**\n * Represents a chunk of a human message, which can be concatenated with\n * other human message chunks.\n */\nexport declare class HumanMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"human\"> {\n static lc_name(): string;\n readonly type: \"human\";\n constructor(fields: $InferMessageContent<TStructure, \"human\"> | HumanMessageFields<TStructure>);\n concat(chunk: HumanMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is HumanMessageChunk;\n}\n/**\n * @deprecated Use {@link HumanMessage.isInstance} instead\n */\nexport declare function isHumanMessage<TStructure extends MessageStructure>(x: BaseMessage): x is HumanMessage<TStructure>;\n/**\n * @deprecated Use {@link HumanMessageChunk.isInstance} instead\n */\nexport declare function isHumanMessageChunk<TStructure extends MessageStructure>(x: BaseMessageChunk): x is HumanMessageChunk<TStructure>;\n"],"mappings":";;;;UAEiBK,sCAAsCD,mBAAmBA,0BAA0BF,kBAAkBI;AAAtH;;;AAA0EF,cAKrDG,YALqDH,CAAAA,mBAKrBA,gBALqBA,GAKFA,gBALEA,CAAAA,SAKwBJ,WALxBI,CAKoCE,UALpCF,EAAAA,OAAAA,CAAAA,CAAAA;EAAgB,OAA4BE,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA5BJ,IAAAA,EAAAA,OAAAA;EAAiB,WAAA,CAAA,MAAA,EAQ7FC,oBAR6F,CAQxEG,UARwE,EAAA,OAAA,CAAA,GAQjDD,kBARiD,CAQ9BC,UAR8B,CAAA;EAKhGC,OAAAA,UAAY,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAIWA,YAJX;;;;;;AAGTJ,cAOHK,iBAPGL,CAAAA,mBAOkCC,gBAPlCD,GAOqDC,gBAPrDD,CAAAA,SAO+EF,gBAP/EE,CAOgGG,UAPhGH,EAAAA,OAAAA,CAAAA,CAAAA;EAAoB,OAA2CG,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA7BD,IAAAA,EAAAA,OAAAA;EAAkB,WAC1CE,CAAAA,MAAAA,EASpBJ,oBAToBI,CASCD,UATDC,EAAAA,OAAAA,CAAAA,GASwBF,kBATxBE,CAS2CD,UAT3CC,CAAAA;EAAY,MAJ0CP,CAAAA,KAAAA,EAchFQ,iBAdgFR,CAc9DM,UAd8DN,CAAAA,CAAAA,EAAAA,IAAAA;EAAW,OAAA,UAAA,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAejEQ,iBAfiE;AAU7G;;;;AAAwHF,iBAUhGG,cAVgGH,CAAAA,mBAU9DF,gBAV8DE,CAAAA,CAAAA,CAAAA,EAUzCN,WAVyCM,CAAAA,EAAAA,CAAAA,IAUtBC,YAVsBD,CAUTA,UAVSA,CAAAA;;;;AAGpDD,iBAW5CK,mBAX4CL,CAAAA,mBAWLD,gBAXKC,CAAAA,CAAAA,CAAAA,EAWgBJ,gBAXhBI,CAAAA,EAAAA,CAAAA,IAWwCG,iBAXxCH,CAW0DC,UAX1DD,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"human.d.ts","names":["BaseMessage","BaseMessageChunk","BaseMessageFields","$InferMessageContent","MessageStructure","HumanMessageFields","TStructure","HumanMessage","HumanMessageChunk","isHumanMessage","isHumanMessageChunk"],"sources":["../../src/messages/human.d.ts"],"sourcesContent":["import { BaseMessage, BaseMessageChunk, type BaseMessageFields } from \"./base.js\";\nimport type { $InferMessageContent, MessageStructure } from \"./message.js\";\nexport interface HumanMessageFields<TStructure extends MessageStructure = MessageStructure> extends BaseMessageFields<TStructure, \"human\"> {\n}\n/**\n * Represents a human message in a conversation.\n */\nexport declare class HumanMessage<TStructure extends MessageStructure = MessageStructure> extends BaseMessage<TStructure, \"human\"> {\n static lc_name(): string;\n readonly type: \"human\";\n constructor(fields: $InferMessageContent<TStructure, \"human\"> | HumanMessageFields<TStructure>);\n static isInstance(obj: unknown): obj is HumanMessage;\n}\n/**\n * Represents a chunk of a human message, which can be concatenated with\n * other human message chunks.\n */\nexport declare class HumanMessageChunk<TStructure extends MessageStructure = MessageStructure> extends BaseMessageChunk<TStructure, \"human\"> {\n static lc_name(): string;\n readonly type: \"human\";\n constructor(fields: $InferMessageContent<TStructure, \"human\"> | HumanMessageFields<TStructure>);\n concat(chunk: HumanMessageChunk<TStructure>): this;\n static isInstance(obj: unknown): obj is HumanMessageChunk;\n}\n/**\n * @deprecated Use {@link HumanMessage.isInstance} instead\n */\nexport declare function isHumanMessage<TStructure extends MessageStructure>(x: BaseMessage): x is HumanMessage<TStructure>;\n/**\n * @deprecated Use {@link HumanMessageChunk.isInstance} instead\n */\nexport declare function isHumanMessageChunk<TStructure extends MessageStructure>(x: BaseMessageChunk): x is HumanMessageChunk<TStructure>;\n"],"mappings":";;;;UAEiBK,sCAAsCD,mBAAmBA,0BAA0BF,kBAAkBI;AAAtH;;;AAA0EF,cAKrDG,YALqDH,CAAAA,mBAKrBA,gBALqBA,GAKFA,gBALEA,CAAAA,SAKwBJ,WALxBI,CAKoCE,UALpCF,EAAAA,OAAAA,CAAAA,CAAAA;EAAgB,OAA4BE,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA5BJ,IAAAA,EAAAA,OAAAA;EAAiB,WAAA,CAAA,MAAA,EAQ7FC,oBAR6F,CAQxEG,UARwE,EAAA,OAAA,CAAA,GAQjDD,kBARiD,CAQ9BC,UAR8B,CAAA;EAKhGC,OAAAA,UAAY,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAIWA,YAJX;;;;;;AAGTJ,cAOHK,iBAPGL,CAAAA,mBAOkCC,gBAPlCD,GAOqDC,gBAPrDD,CAAAA,SAO+EF,gBAP/EE,CAOgGG,UAPhGH,EAAAA,OAAAA,CAAAA,CAAAA;EAAoB,OAA2CG,OAAAA,CAAAA,CAAAA,EAAAA,MAAAA;EAAU,SAA7BD,IAAAA,EAAAA,OAAAA;EAAkB,WAC1CE,CAAAA,MAAAA,EASpBJ,oBAToBI,CASCD,UATDC,EAAAA,OAAAA,CAAAA,GASwBF,kBATxBE,CAS2CD,UAT3CC,CAAAA;EAAY,MAJ0CP,CAAAA,KAAAA,EAchFQ,iBAdgFR,CAc9DM,UAd8DN,CAAAA,CAAAA,EAAAA,IAAAA;EAAW,OAAA,UAAA,CAAA,GAAA,EAAA,OAAA,CAAA,EAAA,GAAA,IAejEQ,iBAfiE;AAU7G;;;;AAAwHF,iBAUhGG,cAVgGH,CAAAA,mBAU9DF,gBAV8DE,CAAAA,CAAAA,CAAAA,EAUzCN,WAVyCM,CAAAA,EAAAA,CAAAA,IAUtBC,YAVsBD,CAUTA,UAVSA,CAAAA;;;;AAGpDD,iBAW5CK,mBAX4CL,CAAAA,mBAWLD,gBAXKC,CAAAA,CAAAA,CAAAA,EAWgBJ,gBAXhBI,CAAAA,EAAAA,CAAAA,IAWwCG,iBAXxCH,CAW0DC,UAX1DD,CAAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.cts","names":["ContentBlock","ResponseMetadata","UsageMetadata","$MergeDiscriminatedUnion","$MergeObjects","MessageType","NonNullable","MessageOutputVersion","MessageToolDefinition","TInput","TOutput","MessageToolSet","$MessageToolCallBlock","MessageStructure","TStructure","K","Tools","ToolCall","Partial","Record","$NormalizeMessageOutputVersion","T","Extract","$MergeOutputVersion","U","TV","UV","Exclude","$MergeContentDefinition","$MergeMessageStructure","StandardMessageStructure","Text","$NormalizedMessageStructure","$InferMessageContentBlocks","S","C","PropertyKey","TRole","$InferMessageContent","Array","$InferMessageProperties","P","Omit","$InferMessageProperty","$InferResponseMetadata","Message","isMessage"],"sources":["../../src/messages/message.d.ts"],"sourcesContent":["import type { ContentBlock } from \"./content/index.js\";\nimport type { ResponseMetadata, UsageMetadata } from \"./metadata.js\";\nimport type { $MergeDiscriminatedUnion, $MergeObjects } from \"./utils.js\";\n/**\n * Represents the possible types of messages in the system.\n * Includes standard message types (\"ai\", \"human\", \"tool\", \"system\")\n * and allows for custom string types that are non-null.\n *\n * @example\n * ```ts\n * // Standard message types\n * const messageType1: MessageType = \"ai\";\n * const messageType2: MessageType = \"human\";\n *\n * // Custom message type\n * const messageType3: MessageType = \"custom_type\";\n * ```\n */\nexport type MessageType = \"ai\" | \"human\" | \"tool\" | \"system\" | (string & NonNullable<unknown>);\n/**\n * Represents the output version format for message content.\n *\n * This type determines how the content field is structured in a message:\n * - \"v0\": Content is represented as a simple string or array of content blocks\n * - provides backward compatibility with simpler content representations\n * - \"v1\": Content follows the structured ContentBlock format with typed discriminated unions\n * - enables full type safety and structured content block handling\n *\n * @example\n * ```ts\n * // v0 format - simple content representation\n * const v0Message: Message<{ outputVersion: \"v0\", content: ... }> = {\n * type: \"human\",\n * content: \"Hello world\" // string | Array<ContentBlock | ContentBlock.Text>\n * };\n *\n * // v1 format - structured content blocks\n * const v1Message: Message<{ outputVersion: \"v1\", content: ... }> = {\n * type: \"human\",\n * content: [\n * { type: \"text\", text: \"Hello world\" },\n * { type: \"image\", image_url: \"...\" }\n * ] // Array<ContentBlock | ...> (determined by the structure)\n * };\n * ```\n */\nexport type MessageOutputVersion = \"v0\" | \"v1\";\n/**\n * Represents the input and output types of a tool that can be used in messages.\n *\n * @template TInput - The type of input the tool accepts.\n * @template TOutput - The type of output the tool produces.\n *\n * @example\n * ```ts\n * // Tool that takes a string input and returns a number\n * interface StringToNumberTool extends MessageToolDefinition<string, number> {\n * input: string;\n * output: number;\n * }\n * ```\n */\nexport interface MessageToolDefinition<TInput = unknown, TOutput = unknown> {\n input: TInput;\n output: TOutput;\n}\n/**\n * Represents a structured set of tools by mapping tool names to definitions\n * that can be used in messages.\n *\n * @example\n * ```ts\n * interface MyToolSet extends MessageToolSet {\n * calculator: MessageToolDefinition<\n * { operation: string; numbers: number[] },\n * number\n * >;\n * translator: MessageToolDefinition<\n * { text: string; targetLanguage: string },\n * string\n * >;\n * }\n * ```\n */\nexport interface MessageToolSet {\n [key: string]: MessageToolDefinition;\n}\n/**\n * Represents a tool call block within a message structure by mapping tool names to their\n * corresponding tool call formats, including the input arguments and an optional identifier.\n *\n * @template TStructure - A message structure type that may contain tool definitions\n *\n * @example\n * ```ts\n * // Given a message structure with a calculator tool:\n * interface MyStructure extends MessageStructure {\n * tools: {\n * calculator: MessageToolDefinition<{ operation: string, numbers: number[] }, number>\n * }\n * }\n *\n * // The tool call block would be:\n * type CalcToolCall = $MessageToolCallBlock<MyStructure>;\n * // Resolves to:\n * // {\n * // type: \"tool_call\";\n * // name: \"calculator\";\n * // args: { operation: string, numbers: number[] };\n * // id?: string;\n * // }\n * ```\n */\nexport type $MessageToolCallBlock<TStructure extends MessageStructure> = TStructure[\"tools\"] extends MessageToolSet ? {\n [K in keyof TStructure[\"tools\"]]: K extends string ? TStructure[\"tools\"][K] extends MessageToolDefinition ? ContentBlock.Tools.ToolCall<K, TStructure[\"tools\"][K][\"input\"]> : never : never;\n}[keyof TStructure[\"tools\"]] : never;\n/**\n * Core interface that defines the structure of messages.\n *\n * @example\n * ```ts\n * // Basic message structure with just content blocks\n * interface SimpleMessageStructure extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * // allows for text + reasoning blocks in ai messages\n * ai: ContentBlock.Text | ContentBlock.Reasoning;\n * }\n * }\n *\n * // Message structure with tools and properties\n * interface AdvancedMessageStructure extends MessageStructure {\n * tools: {\n * calculator: MessageToolDefinition<\n * { operation: string; numbers: number[] },\n * number\n * >;\n * };\n * content: {\n * // allows for text + image blocks in human messages\n * human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * // only allows for text blocks in ai messages\n * ai: ContentBlock.Text;\n * };\n * properties: {\n * // pins properties to ai messages\n * ai: {\n * response_metadata: {\n * confidence: number;\n * model: string;\n * };\n * };\n * }\n * }\n *\n * // Using with $MergeMessageStructure to combine structures\n * // The resulting type when passed into BaseMessage will have a calculator tool,\n * // allow for text + image blocks in human messages,\n * // and text + reasoning blocks + additional arbitrary properties in ai messages.\n * type CombinedStructure = $MergeMessageStructure<\n * SimpleMessageStructure,\n * AdvancedMessageStructure\n * >;\n *\n * // Using in a Message object\n * const message: Message<CombinedStructure> = {\n * id: \"msg-123\",\n * type: \"human\",\n * content: [\n * { type: \"text\", text: \"Hello!\" }\n * { type: \"image\", mimeType: \"image/jpeg\", url: \"https://example.com/image.jpg\" }\n * // this block will throw an error because it's not defined in the structure\n * { type: \"reasoning\", reasoning: \"The answer is 42\" }\n * ]\n * };\n * ```\n */\nexport interface MessageStructure {\n /**\n * Optional output version for the message structure.\n * If not provided, defaults to \"v0\".\n */\n readonly outputVersion?: MessageOutputVersion;\n /**\n * Optional set of tool definitions that can be used in messages.\n * Each tool is defined with input/output types and can be referenced in tool messages.\n */\n readonly tools?: MessageToolSet;\n /**\n * Optional mapping of message types to their allowed content blocks.\n * Each message type can specify what content block types it supports (text, images, etc).\n */\n readonly content?: Partial<{\n [key in MessageType]: ContentBlock;\n }>;\n /**\n * Optional mapping of message types to arbitrary property objects.\n * Allows attaching custom metadata or other information to specific message types.\n */\n readonly properties?: Partial<{\n [key in MessageType]: Record<string, unknown>;\n }>;\n}\n/**\n * Normalizes an arbitrary type to a message output version or undefined.\n * Accepts unknown and narrows to a valid MessageOutputVersion if present.\n */\ntype $NormalizeMessageOutputVersion<T> = Extract<T, MessageOutputVersion> | undefined;\n/**\n * Merges two output version types from message structures.\n *\n * This utility type determines the resulting output version when combining two message structures.\n * The merge logic follows these rules:\n *\n * - If both T and U are undefined, defaults to \"v0\" for backwards compatibility\n * - If T is undefined but U is defined, uses U's version\n * - If U is undefined but T is defined, uses T's version\n * - If both T and U are defined, U takes precedence (later structure wins)\n *\n * @template T - The output version from the first message structure\n * @template U - The output version from the second message structure\n *\n * @example\n * ```ts\n * // Both undefined - defaults to \"v0\"\n * type Result1 = $MergeOutputVersion<undefined, undefined>; // \"v0\"\n *\n * // One defined - uses the defined version\n * type Result2 = $MergeOutputVersion<undefined, \"v1\">; // \"v1\"\n * type Result3 = $MergeOutputVersion<\"v0\", undefined>; // \"v0\"\n *\n * // Both defined - second takes precedence\n * type Result4 = $MergeOutputVersion<\"v0\", \"v1\">; // \"v1\"\n * ```\n */\nexport type $MergeOutputVersion<T, U> = $NormalizeMessageOutputVersion<T> extends infer TV ? $NormalizeMessageOutputVersion<U> extends infer UV ? [TV, UV] extends [undefined, undefined] ? \"v0\" : [TV] extends [undefined] ? Exclude<UV, undefined> : [UV] extends [undefined] ? Exclude<TV, undefined> : UV : never : never;\n/**\n * Merges two content definition objects from message structures.\n *\n * This utility type combines content definitions from two message structures, handling\n * the merging of content block types for each message type. The merge logic follows\n * these rules:\n *\n * - For keys that exist in both T and U: Merges the content blocks using discriminated\n * union merging based on the \"type\" property. This allows combining different content\n * block types (e.g., text + image) for the same message type.\n * - For keys that exist only in T: Uses T's content definition as-is\n * - For keys that exist only in U: Uses U's content definition as-is\n *\n * @template T - The content definition from the first message structure\n * @template U - The content definition from the second message structure\n *\n * @example\n * ```ts\n * // T allows text content for human messages\n * type ContentA = {\n * human: ContentBlock.Text;\n * };\n *\n * // U allows image content for human messages and text for AI messages\n * type ContentB = {\n * human: ContentBlock.Multimodal.Image;\n * ai: ContentBlock.Text;\n * };\n *\n * // Merged result allows both text and images for human messages, text for AI\n * type Merged = $MergeContentDefinition<ContentA, ContentB>;\n * // Result: {\n * // human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * // ai: ContentBlock.Text;\n * // }\n * ```\n */\nexport type $MergeContentDefinition<T, U> = {\n [K in keyof T | keyof U as Extract<(K extends keyof T ? T[K] : never) | (K extends keyof U ? U[K] : never), ContentBlock> extends never ? never : K]: K extends keyof T ? K extends keyof U ? $MergeDiscriminatedUnion<Extract<T[K], ContentBlock>, Extract<U[K], ContentBlock>, \"type\"> : Extract<T[K], ContentBlock> : K extends keyof U ? Extract<U[K], ContentBlock> : never;\n};\n/**\n * Merges two message structures A and B into a combined structure.\n * This is a type utility that handles merging of tools, content blocks, and properties\n * from two message structures. The resulting type is usable as its own message structure.\n *\n * @example\n * ```ts\n * // Structure A allows text in human messages and has a confidence property on AI messages\n * interface StructureA extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * };\n * properties: {\n * ai: { confidence: number };\n * }\n * }\n *\n * // Structure B allows images in human messages and has a model property on AI messages\n * interface StructureB extends MessageStructure {\n * content: {\n * human: ContentBlock.Multimodal.Image;\n * };\n * properties: {\n * ai: { model: string };\n * }\n * }\n *\n * // Merged structure allows both text and images in human messages\n * // AI messages have both confidence and model properties\n * type Merged = $MergeMessageStructure<StructureA, StructureB>;\n * ```\n *\n * @template A - First message structure to merge\n * @template B - Second message structure to merge (takes precedence over A)\n */\nexport type $MergeMessageStructure<T extends MessageStructure, U extends MessageStructure> = {\n outputVersion: $MergeOutputVersion<T[\"outputVersion\"], U[\"outputVersion\"]>;\n tools: $MergeObjects<T[\"tools\"], U[\"tools\"]>;\n content: $MergeContentDefinition<T[\"content\"], U[\"content\"]>;\n properties: $MergeObjects<T[\"properties\"], U[\"properties\"]>;\n};\n/**\n * Standard message structured used to define the most basic message structure that's\n * used throughout the library.\n *\n * This is also the message structure that's used when a message structure is not provided.\n */\nexport interface StandardMessageStructure extends MessageStructure {\n content: {\n /** Text content for AI messages */\n ai: ContentBlock.Text;\n /** Text content for human messages */\n human: ContentBlock.Text;\n /** Text content for system messages */\n system: ContentBlock.Text;\n /** Text content for tool messages */\n tool: ContentBlock.Text;\n };\n properties: {\n /** Properties specific to AI messages */\n ai: {\n /** Metadata about the AI model response */\n response_metadata: ResponseMetadata;\n /** Usage statistics for the AI response */\n usage_metadata: UsageMetadata;\n };\n human: {\n /** Metadata about the human message */\n response_metadata: Record<string, unknown>;\n };\n system: {\n /** Metadata about the system message */\n response_metadata: Record<string, unknown>;\n };\n tool: {\n /** Metadata about the tool message */\n response_metadata: Record<string, unknown>;\n };\n };\n}\n/**\n * Takes a message structure type T and normalizes it by merging it with the standard message structure.\n * If T is already a standard message structure, returns T unchanged.\n *\n * This ensures that any custom message structure includes all the standard message structure fields\n * by default while allowing overrides and extensions.\n *\n * @template T - The message structure type to normalize, must extend MessageStructure\n * @returns Either T if it's already a standard structure, or the merged result of T with standard structure\n */\nexport type $NormalizedMessageStructure<T extends MessageStructure> = T extends StandardMessageStructure ? T : $MergeMessageStructure<StandardMessageStructure, T>;\n/**\n * Infers the content blocks for a specific message type in a message structure.\n *\n * This utility type extracts the content block type that corresponds to a given message type\n * from the message structure's content definition.\n *\n * @template TStructure - The message structure to infer content from\n * @template TRole - The message role/type to get content for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The content block type for the specified type, or never if its not defined in the structure\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.ToolCall;\n * };\n * }\n *\n * type HumanContent = $InferMessageContentBlocks<MyStructure, \"human\">;\n * // HumanContent = ContentBlock.Text\n *\n * type AIContent = $InferMessageContentBlocks<MyStructure, \"ai\">;\n * // AIContent = ContentBlock.Text | ContentBlock.ToolCall\n * ```\n */\nexport type $InferMessageContentBlocks<TStructure extends MessageStructure, TRole extends MessageType> = $NormalizedMessageStructure<TStructure> extends infer S ? S extends MessageStructure ? S[\"content\"] extends infer C ? C extends Record<PropertyKey, ContentBlock> ? TRole extends keyof C ? [$MessageToolCallBlock<TStructure>] extends [never] ? C[TRole] : $MergeDiscriminatedUnion<NonNullable<C[TRole]>, $MessageToolCallBlock<TStructure>, \"type\"> : never : never : never : never : never;\n/**\n * Infers the content type for a specific message type from a message structure.\n *\n * This utility type determines the appropriate content type based on the message structure's\n * output version and the specified message type. The content type varies depending on the\n * output version (see {@link MessageOutputVersion})\n *\n * @template TStructure - The message structure to infer content from\n * @template TRole - The message role/type to get content for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The content type for the specified role based on the output version\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * outputVersion: \"v0\";\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.ToolCall;\n * };\n * }\n *\n * type HumanContentV0 = $InferMessageContent<MyStructure, \"human\">;\n * // HumanContentV0 = string | Array<ContentBlock | ContentBlock.Text>\n *\n * interface MyStructureV1 extends MessageStructure {\n * outputVersion: \"v1\";\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.Reasoning;\n * };\n * }\n *\n * type HumanContentV1 = $InferMessageContent<MyStructureV1, \"human\">;\n * // HumanContentV1 = ContentBlock.Text\n *\n * type AIContentV1 = $InferMessageContent<MyStructureV1, \"ai\">;\n * // AIContentV1 = ContentBlock.Text | ContentBlock.Reasoning\n * ```\n */\nexport type $InferMessageContent<TStructure extends MessageStructure, TRole extends MessageType> = TStructure[\"outputVersion\"] extends \"v1\" ? Array<$InferMessageContentBlocks<TStructure, TRole>> : string | Array<ContentBlock | ContentBlock.Text>;\n/**\n * Infers the properties for a specific message type from a message structure.\n *\n * This utility type extracts the properties object that corresponds to a given message type\n * from the message structure's properties definition, and excludes the reserved\n * \"content\" and \"type\" properties to avoid conflicts with the core message structure.\n *\n * If the specified type is not defined in the message structure's properties, it returns\n * a generic Record<string, unknown> type to allow for arbitrary properties.\n *\n * @template TStructure - The message structure to infer properties from\n * @template TRole - The message type/role to get properties for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The properties object type for the specified type, excluding \"content\" and \"type\"\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string };\n * usage_metadata: { tokens: number };\n * content: string; // This will be omitted\n * type: string; // This will be omitted\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type AIProperties = $InferMessageProperties<MyStructure, \"ai\">;\n * // AIProperties = { response_metadata: { model: string }; usage_metadata: { tokens: number } }\n *\n * type HumanProperties = $InferMessageProperties<MyStructure, \"human\">;\n * // HumanProperties = { metadata: Record<string, unknown> }\n *\n * type SystemProperties = $InferMessageProperties<MyStructure, \"system\">;\n * // SystemProperties = Record<string, unknown> (fallback for undefined role)\n * ```\n */\nexport type $InferMessageProperties<TStructure extends MessageStructure, TRole extends MessageType> = $NormalizedMessageStructure<TStructure> extends infer S ? S extends MessageStructure ? S[\"properties\"] extends infer P | undefined ? P extends Record<PropertyKey, unknown> ? TRole extends keyof P ? Omit<P[TRole], \"content\" | \"type\"> : Record<string, unknown> : Record<string, unknown> : Record<string, unknown> : never : never;\n/**\n * Infers the type of a specific property for a message type from a message structure.\n *\n * This utility type extracts the type of a single property by name from the properties\n * object that corresponds to a given message type. If the specified property key does\n * not exist in the type's properties, it returns `never`.\n *\n * @template TStructure - The message structure to infer the property from\n * @template TRole - The message type/role to get the property for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @template K - The property key to extract the type for\n * @returns The type of the specified property, or `never` if the property doesn't exist\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string; temperature: number };\n * usage_metadata: { input_tokens: number; output_tokens: number };\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type ResponseMetadata = $InferMessageProperty<MyStructure, \"ai\", \"response_metadata\">;\n * // ResponseMetadata = { model: string; temperature: number }\n *\n * type UsageMetadata = $InferMessageProperty<MyStructure, \"ai\", \"usage_metadata\">;\n * // UsageMetadata = { input_tokens: number; output_tokens: number }\n *\n * type NonExistentProperty = $InferMessageProperty<MyStructure, \"ai\", \"nonExistent\">;\n * // NonExistentProperty = Record<string, unknown>\n *\n * type HumanMetadata = $InferMessageProperty<MyStructure, \"human\", \"metadata\">;\n * // HumanMetadata = Record<string, unknown>\n * ```\n */\nexport type $InferMessageProperty<TStructure extends MessageStructure, TRole extends MessageType, K extends string> = K extends keyof $InferMessageProperties<TStructure, TRole> ? $InferMessageProperties<TStructure, TRole>[K] : never;\n/**\n * Infers the response metadata type for a specific message type from a message structure.\n *\n * This utility type extracts the `response_metadata` property type for a given message type.\n *\n * @template TStructure - The message structure to infer the response metadata from\n * @template TRole - The message type/role to get the response metadata for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The type of the response_metadata property, or `Record<string, unknown>` as fallback\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string; temperature: number; tokens: number };\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type AIResponseMetadata = $InferResponseMetadata<MyStructure, \"ai\">;\n * // AIResponseMetadata = { model: string; temperature: number; tokens: number }\n *\n * type HumanResponseMetadata = $InferResponseMetadata<MyStructure, \"human\">;\n * // HumanResponseMetadata = Record<string, unknown> (fallback since not defined)\n * ```\n */\nexport type $InferResponseMetadata<TStructure extends MessageStructure, TRole extends MessageType> = $InferMessageProperty<TStructure, TRole, \"response_metadata\"> extends infer P ? [P] extends [never] ? Record<string, unknown> : P : never;\n/**\n * Represents a message object that organizes context for an LLM.\n *\n * @example\n * ```ts\n * // Basic message with text content\n * const message: Message = {\n * id: \"msg-123\",\n * name: \"user\",\n * type: \"human\",\n * content: [{ type: \"text\", text: \"Hello!\" }]\n * };\n *\n * // Basic ai message interface extension\n * interface MyMessage extends Message<StandardMessageStructure, \"ai\"> {\n * // Additional AI-specific properties can be added here\n * }\n *`\n * // Custom message structure\n * interface CustomStructure extends MessageStructure {\n * content: {\n * ai: ContentBlock.Text | ContentBlock.ToolCall<\"search\", { query: string }>;\n * human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * };\n * }\n *\n * // Create a message with custom structure\n * const message: Message<CustomStructure> = {\n * id: \"msg-123\",\n * name: \"user\",\n * type: \"ai\",\n * content: [\n * { type: \"text\", text: \"Hello!\" },\n * {\n * type: \"tool_call\",\n * name: \"search\",\n * args: { query: \"What is the capital of France?\" }\n * }\n * ]\n * };\n * ```\n */\nexport interface Message<TStructure extends MessageStructure = StandardMessageStructure, TRole extends MessageType = MessageType> {\n /** The message type/role */\n readonly type: TRole;\n /** Unique identifier for this message */\n id?: string;\n /** Optional name/identifier for the entity that created this message */\n name?: string;\n /** Array of content blocks that make up the message content */\n content: $InferMessageContent<TStructure, TRole>;\n /** Metadata about the message */\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n}\n/**\n * Type guard to check if a value is a valid Message object.\n *\n * @param message - The value to check\n * @returns true if the value is a valid Message object, false otherwise\n */\nexport declare function isMessage(message: unknown): message is Message;\nexport {};\n"],"mappings":";;;;;;;;AAkBA;AA4BA;AAgBA;;;;AAEmB;AAoBnB;AA6BA;;;;;AACgBc,KAhGJT,WAAAA,GAgGIS,IAAAA,GAAAA,OAAAA,GAAAA,MAAAA,GAAAA,QAAAA,GAAAA,CAAAA,MAAAA,GAhGyDR,WAgGzDQ,CAAAA,OAAAA,CAAAA,CAAAA;;;;;;;;;;AACE;AA8DlB;;;;;;;;;;AAsBiC;AAGhC;;;;;AAK+C;AA4BpCS,KA7LAhB,oBAAAA,GA6LmB,IAAA,GAAA,IAAA;;;;;;;;;;;;;;;AAA8Q;AAsCjSqB,UAnNKpB,qBAmNkB,CAAA,SAAA,OAAA,EAAA,UAAA,OAAA,CAAA,CAAA;EAAA,KAAA,EAlNxBC,MAkNwB;EAAA,MACnBY,EAlNJX,OAkNIW;;;;;;;;;;;;;;;;;;;;AAA2MC,UA9L1MX,cAAAA,CA8L0MW;EAAO,CAAA,GAA8BE,EAAAA,MAAAA,CAAAA,EA7L7OhB,qBA6L6OgB;;;;;;;;;;;;;;;AAAwF;AAqCxV;;;;;;;;;;;;AAGaI,KAzMDhB,qBAyMCgB,CAAAA,mBAzMwCf,gBAyMxCe,CAAAA,GAzM4Dd,UAyM5Dc,CAAAA,OAAAA,CAAAA,SAzMwFjB,cAyMxFiB,GAAAA,QACiBP,MAzMdP,UAyMcO,CAAAA,OAAAA,CAAAA,GAzMQN,CAyMRM,SAAAA,MAAAA,GAzM2BP,UAyM3BO,CAAAA,OAAAA,CAAAA,CAzM+CN,CAyM/CM,CAAAA,SAzM0Db,qBAyM1Da,GAzMkFrB,YAAAA,CAAagB,KAAAA,CAAMC,QAyMrGI,CAzM8GN,CAyM9GM,EAzMiHP,UAyMjHO,CAAAA,OAAAA,CAAAA,CAzMqIN,CAyMrIM,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,GAAAA,KAAAA,GAAAA,KAAAA,EA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,YAAY6B,EAAEE,SAASzB,sBAAsBE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAwChawB,wCAAwCzB,gCAAgCR,eAAeS,2CAA2CyB,MAAMN,2BAA2BnB,YAAYuB,mBAAmBE,MAAMvC,eAAeA,YAAAA,CAAa+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCpOS,2CAA2C3B,gCAAgCR,eAAe2B,4BAA4BlB,8BAA8BoB,UAAUrB,mBAAmBqB,8CAA8CO,UAAUtB,OAAOiB,wBAAwBC,oBAAoBI,IAAIC,KAAKD,EAAEJ,8BAA8BlB,0BAA0BA,0BAA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsCzXwB,yCAAyC9B,gCAAgCR,iCAAiCU,gBAAgByB,wBAAwB1B,YAAYuB,SAASG,wBAAwB1B,YAAYuB,OAAOtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BlN6B,0CAA0C/B,gCAAgCR,eAAesC,sBAAsB7B,YAAYuB,+CAA+CI,qBAAqBtB,0BAA0BsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2CpNI,2BAA2BhC,mBAAmBiB,wCAAwCzB,cAAcA;;iBAElGgC;;;;;;WAMNC,qBAAqBxB,YAAYuB;;sBAEtBnB,QAAQ0B,uBAAuB9B,YAAYuB;;;;;;;;iBAQ3CS,SAAAA,+BAAwCD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","names":["ContentBlock","ResponseMetadata","UsageMetadata","$MergeDiscriminatedUnion","$MergeObjects","MessageType","NonNullable","MessageOutputVersion","MessageToolDefinition","TInput","TOutput","MessageToolSet","$MessageToolCallBlock","MessageStructure","TStructure","K","Tools","ToolCall","Partial","Record","$NormalizeMessageOutputVersion","T","Extract","$MergeOutputVersion","U","TV","UV","Exclude","$MergeContentDefinition","$MergeMessageStructure","StandardMessageStructure","Text","$NormalizedMessageStructure","$InferMessageContentBlocks","S","C","PropertyKey","TRole","$InferMessageContent","Array","$InferMessageProperties","P","Omit","$InferMessageProperty","$InferResponseMetadata","Message","isMessage"],"sources":["../../src/messages/message.d.ts"],"sourcesContent":["import type { ContentBlock } from \"./content/index.js\";\nimport type { ResponseMetadata, UsageMetadata } from \"./metadata.js\";\nimport type { $MergeDiscriminatedUnion, $MergeObjects } from \"./utils.js\";\n/**\n * Represents the possible types of messages in the system.\n * Includes standard message types (\"ai\", \"human\", \"tool\", \"system\")\n * and allows for custom string types that are non-null.\n *\n * @example\n * ```ts\n * // Standard message types\n * const messageType1: MessageType = \"ai\";\n * const messageType2: MessageType = \"human\";\n *\n * // Custom message type\n * const messageType3: MessageType = \"custom_type\";\n * ```\n */\nexport type MessageType = \"ai\" | \"human\" | \"tool\" | \"system\" | (string & NonNullable<unknown>);\n/**\n * Represents the output version format for message content.\n *\n * This type determines how the content field is structured in a message:\n * - \"v0\": Content is represented as a simple string or array of content blocks\n * - provides backward compatibility with simpler content representations\n * - \"v1\": Content follows the structured ContentBlock format with typed discriminated unions\n * - enables full type safety and structured content block handling\n *\n * @example\n * ```ts\n * // v0 format - simple content representation\n * const v0Message: Message<{ outputVersion: \"v0\", content: ... }> = {\n * type: \"human\",\n * content: \"Hello world\" // string | Array<ContentBlock | ContentBlock.Text>\n * };\n *\n * // v1 format - structured content blocks\n * const v1Message: Message<{ outputVersion: \"v1\", content: ... }> = {\n * type: \"human\",\n * content: [\n * { type: \"text\", text: \"Hello world\" },\n * { type: \"image\", image_url: \"...\" }\n * ] // Array<ContentBlock | ...> (determined by the structure)\n * };\n * ```\n */\nexport type MessageOutputVersion = \"v0\" | \"v1\";\n/**\n * Represents the input and output types of a tool that can be used in messages.\n *\n * @template TInput - The type of input the tool accepts.\n * @template TOutput - The type of output the tool produces.\n *\n * @example\n * ```ts\n * // Tool that takes a string input and returns a number\n * interface StringToNumberTool extends MessageToolDefinition<string, number> {\n * input: string;\n * output: number;\n * }\n * ```\n */\nexport interface MessageToolDefinition<TInput = unknown, TOutput = unknown> {\n input: TInput;\n output: TOutput;\n}\n/**\n * Represents a structured set of tools by mapping tool names to definitions\n * that can be used in messages.\n *\n * @example\n * ```ts\n * interface MyToolSet extends MessageToolSet {\n * calculator: MessageToolDefinition<\n * { operation: string; numbers: number[] },\n * number\n * >;\n * translator: MessageToolDefinition<\n * { text: string; targetLanguage: string },\n * string\n * >;\n * }\n * ```\n */\nexport interface MessageToolSet {\n [key: string]: MessageToolDefinition;\n}\n/**\n * Represents a tool call block within a message structure by mapping tool names to their\n * corresponding tool call formats, including the input arguments and an optional identifier.\n *\n * @template TStructure - A message structure type that may contain tool definitions\n *\n * @example\n * ```ts\n * // Given a message structure with a calculator tool:\n * interface MyStructure extends MessageStructure {\n * tools: {\n * calculator: MessageToolDefinition<{ operation: string, numbers: number[] }, number>\n * }\n * }\n *\n * // The tool call block would be:\n * type CalcToolCall = $MessageToolCallBlock<MyStructure>;\n * // Resolves to:\n * // {\n * // type: \"tool_call\";\n * // name: \"calculator\";\n * // args: { operation: string, numbers: number[] };\n * // id?: string;\n * // }\n * ```\n */\nexport type $MessageToolCallBlock<TStructure extends MessageStructure> = TStructure[\"tools\"] extends MessageToolSet ? {\n [K in keyof TStructure[\"tools\"]]: K extends string ? TStructure[\"tools\"][K] extends MessageToolDefinition ? ContentBlock.Tools.ToolCall<K, TStructure[\"tools\"][K][\"input\"]> : never : never;\n}[keyof TStructure[\"tools\"]] : never;\n/**\n * Core interface that defines the structure of messages.\n *\n * @example\n * ```ts\n * // Basic message structure with just content blocks\n * interface SimpleMessageStructure extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * // allows for text + reasoning blocks in ai messages\n * ai: ContentBlock.Text | ContentBlock.Reasoning;\n * }\n * }\n *\n * // Message structure with tools and properties\n * interface AdvancedMessageStructure extends MessageStructure {\n * tools: {\n * calculator: MessageToolDefinition<\n * { operation: string; numbers: number[] },\n * number\n * >;\n * };\n * content: {\n * // allows for text + image blocks in human messages\n * human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * // only allows for text blocks in ai messages\n * ai: ContentBlock.Text;\n * };\n * properties: {\n * // pins properties to ai messages\n * ai: {\n * response_metadata: {\n * confidence: number;\n * model: string;\n * };\n * };\n * }\n * }\n *\n * // Using with $MergeMessageStructure to combine structures\n * // The resulting type when passed into BaseMessage will have a calculator tool,\n * // allow for text + image blocks in human messages,\n * // and text + reasoning blocks + additional arbitrary properties in ai messages.\n * type CombinedStructure = $MergeMessageStructure<\n * SimpleMessageStructure,\n * AdvancedMessageStructure\n * >;\n *\n * // Using in a Message object\n * const message: Message<CombinedStructure> = {\n * id: \"msg-123\",\n * type: \"human\",\n * content: [\n * { type: \"text\", text: \"Hello!\" }\n * { type: \"image\", mimeType: \"image/jpeg\", url: \"https://example.com/image.jpg\" }\n * // this block will throw an error because it's not defined in the structure\n * { type: \"reasoning\", reasoning: \"The answer is 42\" }\n * ]\n * };\n * ```\n */\nexport interface MessageStructure {\n /**\n * Optional output version for the message structure.\n * If not provided, defaults to \"v0\".\n */\n readonly outputVersion?: MessageOutputVersion;\n /**\n * Optional set of tool definitions that can be used in messages.\n * Each tool is defined with input/output types and can be referenced in tool messages.\n */\n readonly tools?: MessageToolSet;\n /**\n * Optional mapping of message types to their allowed content blocks.\n * Each message type can specify what content block types it supports (text, images, etc).\n */\n readonly content?: Partial<{\n [key in MessageType]: ContentBlock;\n }>;\n /**\n * Optional mapping of message types to arbitrary property objects.\n * Allows attaching custom metadata or other information to specific message types.\n */\n readonly properties?: Partial<{\n [key in MessageType]: Record<string, unknown>;\n }>;\n}\n/**\n * Normalizes an arbitrary type to a message output version or undefined.\n * Accepts unknown and narrows to a valid MessageOutputVersion if present.\n */\ntype $NormalizeMessageOutputVersion<T> = Extract<T, MessageOutputVersion> | undefined;\n/**\n * Merges two output version types from message structures.\n *\n * This utility type determines the resulting output version when combining two message structures.\n * The merge logic follows these rules:\n *\n * - If both T and U are undefined, defaults to \"v0\" for backwards compatibility\n * - If T is undefined but U is defined, uses U's version\n * - If U is undefined but T is defined, uses T's version\n * - If both T and U are defined, U takes precedence (later structure wins)\n *\n * @template T - The output version from the first message structure\n * @template U - The output version from the second message structure\n *\n * @example\n * ```ts\n * // Both undefined - defaults to \"v0\"\n * type Result1 = $MergeOutputVersion<undefined, undefined>; // \"v0\"\n *\n * // One defined - uses the defined version\n * type Result2 = $MergeOutputVersion<undefined, \"v1\">; // \"v1\"\n * type Result3 = $MergeOutputVersion<\"v0\", undefined>; // \"v0\"\n *\n * // Both defined - second takes precedence\n * type Result4 = $MergeOutputVersion<\"v0\", \"v1\">; // \"v1\"\n * ```\n */\nexport type $MergeOutputVersion<T, U> = $NormalizeMessageOutputVersion<T> extends infer TV ? $NormalizeMessageOutputVersion<U> extends infer UV ? [TV, UV] extends [undefined, undefined] ? \"v0\" : [TV] extends [undefined] ? Exclude<UV, undefined> : [UV] extends [undefined] ? Exclude<TV, undefined> : UV : never : never;\n/**\n * Merges two content definition objects from message structures.\n *\n * This utility type combines content definitions from two message structures, handling\n * the merging of content block types for each message type. The merge logic follows\n * these rules:\n *\n * - For keys that exist in both T and U: Merges the content blocks using discriminated\n * union merging based on the \"type\" property. This allows combining different content\n * block types (e.g., text + image) for the same message type.\n * - For keys that exist only in T: Uses T's content definition as-is\n * - For keys that exist only in U: Uses U's content definition as-is\n *\n * @template T - The content definition from the first message structure\n * @template U - The content definition from the second message structure\n *\n * @example\n * ```ts\n * // T allows text content for human messages\n * type ContentA = {\n * human: ContentBlock.Text;\n * };\n *\n * // U allows image content for human messages and text for AI messages\n * type ContentB = {\n * human: ContentBlock.Multimodal.Image;\n * ai: ContentBlock.Text;\n * };\n *\n * // Merged result allows both text and images for human messages, text for AI\n * type Merged = $MergeContentDefinition<ContentA, ContentB>;\n * // Result: {\n * // human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * // ai: ContentBlock.Text;\n * // }\n * ```\n */\nexport type $MergeContentDefinition<T, U> = {\n [K in keyof T | keyof U as Extract<(K extends keyof T ? T[K] : never) | (K extends keyof U ? U[K] : never), ContentBlock> extends never ? never : K]: K extends keyof T ? K extends keyof U ? $MergeDiscriminatedUnion<Extract<T[K], ContentBlock>, Extract<U[K], ContentBlock>, \"type\"> : Extract<T[K], ContentBlock> : K extends keyof U ? Extract<U[K], ContentBlock> : never;\n};\n/**\n * Merges two message structures A and B into a combined structure.\n * This is a type utility that handles merging of tools, content blocks, and properties\n * from two message structures. The resulting type is usable as its own message structure.\n *\n * @example\n * ```ts\n * // Structure A allows text in human messages and has a confidence property on AI messages\n * interface StructureA extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * };\n * properties: {\n * ai: { confidence: number };\n * }\n * }\n *\n * // Structure B allows images in human messages and has a model property on AI messages\n * interface StructureB extends MessageStructure {\n * content: {\n * human: ContentBlock.Multimodal.Image;\n * };\n * properties: {\n * ai: { model: string };\n * }\n * }\n *\n * // Merged structure allows both text and images in human messages\n * // AI messages have both confidence and model properties\n * type Merged = $MergeMessageStructure<StructureA, StructureB>;\n * ```\n *\n * @template A - First message structure to merge\n * @template B - Second message structure to merge (takes precedence over A)\n */\nexport type $MergeMessageStructure<T extends MessageStructure, U extends MessageStructure> = {\n outputVersion: $MergeOutputVersion<T[\"outputVersion\"], U[\"outputVersion\"]>;\n tools: $MergeObjects<T[\"tools\"], U[\"tools\"]>;\n content: $MergeContentDefinition<T[\"content\"], U[\"content\"]>;\n properties: $MergeObjects<T[\"properties\"], U[\"properties\"]>;\n};\n/**\n * Standard message structured used to define the most basic message structure that's\n * used throughout the library.\n *\n * This is also the message structure that's used when a message structure is not provided.\n */\nexport interface StandardMessageStructure extends MessageStructure {\n content: {\n /** Text content for AI messages */\n ai: ContentBlock.Text;\n /** Text content for human messages */\n human: ContentBlock.Text;\n /** Text content for system messages */\n system: ContentBlock.Text;\n /** Text content for tool messages */\n tool: ContentBlock.Text;\n };\n properties: {\n /** Properties specific to AI messages */\n ai: {\n /** Metadata about the AI model response */\n response_metadata: ResponseMetadata;\n /** Usage statistics for the AI response */\n usage_metadata: UsageMetadata;\n };\n human: {\n /** Metadata about the human message */\n response_metadata: Record<string, unknown>;\n };\n system: {\n /** Metadata about the system message */\n response_metadata: Record<string, unknown>;\n };\n tool: {\n /** Metadata about the tool message */\n response_metadata: Record<string, unknown>;\n };\n };\n}\n/**\n * Takes a message structure type T and normalizes it by merging it with the standard message structure.\n * If T is already a standard message structure, returns T unchanged.\n *\n * This ensures that any custom message structure includes all the standard message structure fields\n * by default while allowing overrides and extensions.\n *\n * @template T - The message structure type to normalize, must extend MessageStructure\n * @returns Either T if it's already a standard structure, or the merged result of T with standard structure\n */\nexport type $NormalizedMessageStructure<T extends MessageStructure> = T extends StandardMessageStructure ? T : $MergeMessageStructure<StandardMessageStructure, T>;\n/**\n * Infers the content blocks for a specific message type in a message structure.\n *\n * This utility type extracts the content block type that corresponds to a given message type\n * from the message structure's content definition.\n *\n * @template TStructure - The message structure to infer content from\n * @template TRole - The message role/type to get content for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The content block type for the specified type, or never if its not defined in the structure\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.ToolCall;\n * };\n * }\n *\n * type HumanContent = $InferMessageContentBlocks<MyStructure, \"human\">;\n * // HumanContent = ContentBlock.Text\n *\n * type AIContent = $InferMessageContentBlocks<MyStructure, \"ai\">;\n * // AIContent = ContentBlock.Text | ContentBlock.ToolCall\n * ```\n */\nexport type $InferMessageContentBlocks<TStructure extends MessageStructure, TRole extends MessageType> = $NormalizedMessageStructure<TStructure> extends infer S ? S extends MessageStructure ? S[\"content\"] extends infer C ? C extends Record<PropertyKey, ContentBlock> ? TRole extends keyof C ? [$MessageToolCallBlock<TStructure>] extends [never] ? C[TRole] : $MergeDiscriminatedUnion<NonNullable<C[TRole]>, $MessageToolCallBlock<TStructure>, \"type\"> : never : never : never : never : never;\n/**\n * Infers the content type for a specific message type from a message structure.\n *\n * This utility type determines the appropriate content type based on the message structure's\n * output version and the specified message type. The content type varies depending on the\n * output version (see {@link MessageOutputVersion})\n *\n * @template TStructure - The message structure to infer content from\n * @template TRole - The message role/type to get content for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The content type for the specified role based on the output version\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * outputVersion: \"v0\";\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.ToolCall;\n * };\n * }\n *\n * type HumanContentV0 = $InferMessageContent<MyStructure, \"human\">;\n * // HumanContentV0 = string | Array<ContentBlock | ContentBlock.Text>\n *\n * interface MyStructureV1 extends MessageStructure {\n * outputVersion: \"v1\";\n * content: {\n * human: ContentBlock.Text;\n * ai: ContentBlock.Text | ContentBlock.Reasoning;\n * };\n * }\n *\n * type HumanContentV1 = $InferMessageContent<MyStructureV1, \"human\">;\n * // HumanContentV1 = ContentBlock.Text\n *\n * type AIContentV1 = $InferMessageContent<MyStructureV1, \"ai\">;\n * // AIContentV1 = ContentBlock.Text | ContentBlock.Reasoning\n * ```\n */\nexport type $InferMessageContent<TStructure extends MessageStructure, TRole extends MessageType> = TStructure[\"outputVersion\"] extends \"v1\" ? Array<$InferMessageContentBlocks<TStructure, TRole>> : string | Array<ContentBlock | ContentBlock.Text>;\n/**\n * Infers the properties for a specific message type from a message structure.\n *\n * This utility type extracts the properties object that corresponds to a given message type\n * from the message structure's properties definition, and excludes the reserved\n * \"content\" and \"type\" properties to avoid conflicts with the core message structure.\n *\n * If the specified type is not defined in the message structure's properties, it returns\n * a generic Record<string, unknown> type to allow for arbitrary properties.\n *\n * @template TStructure - The message structure to infer properties from\n * @template TRole - The message type/role to get properties for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The properties object type for the specified type, excluding \"content\" and \"type\"\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string };\n * usage_metadata: { tokens: number };\n * content: string; // This will be omitted\n * type: string; // This will be omitted\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type AIProperties = $InferMessageProperties<MyStructure, \"ai\">;\n * // AIProperties = { response_metadata: { model: string }; usage_metadata: { tokens: number } }\n *\n * type HumanProperties = $InferMessageProperties<MyStructure, \"human\">;\n * // HumanProperties = { metadata: Record<string, unknown> }\n *\n * type SystemProperties = $InferMessageProperties<MyStructure, \"system\">;\n * // SystemProperties = Record<string, unknown> (fallback for undefined role)\n * ```\n */\nexport type $InferMessageProperties<TStructure extends MessageStructure, TRole extends MessageType> = $NormalizedMessageStructure<TStructure> extends infer S ? S extends MessageStructure ? S[\"properties\"] extends infer P | undefined ? P extends Record<PropertyKey, unknown> ? TRole extends keyof P ? Omit<P[TRole], \"content\" | \"type\"> : Record<string, unknown> : Record<string, unknown> : Record<string, unknown> : never : never;\n/**\n * Infers the type of a specific property for a message type from a message structure.\n *\n * This utility type extracts the type of a single property by name from the properties\n * object that corresponds to a given message type. If the specified property key does\n * not exist in the type's properties, it returns `never`.\n *\n * @template TStructure - The message structure to infer the property from\n * @template TRole - The message type/role to get the property for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @template K - The property key to extract the type for\n * @returns The type of the specified property, or `never` if the property doesn't exist\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string; temperature: number };\n * usage_metadata: { input_tokens: number; output_tokens: number };\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type ResponseMetadata = $InferMessageProperty<MyStructure, \"ai\", \"response_metadata\">;\n * // ResponseMetadata = { model: string; temperature: number }\n *\n * type UsageMetadata = $InferMessageProperty<MyStructure, \"ai\", \"usage_metadata\">;\n * // UsageMetadata = { input_tokens: number; output_tokens: number }\n *\n * type NonExistentProperty = $InferMessageProperty<MyStructure, \"ai\", \"nonExistent\">;\n * // NonExistentProperty = Record<string, unknown>\n *\n * type HumanMetadata = $InferMessageProperty<MyStructure, \"human\", \"metadata\">;\n * // HumanMetadata = Record<string, unknown>\n * ```\n */\nexport type $InferMessageProperty<TStructure extends MessageStructure, TRole extends MessageType, K extends string> = K extends keyof $InferMessageProperties<TStructure, TRole> ? $InferMessageProperties<TStructure, TRole>[K] : never;\n/**\n * Infers the response metadata type for a specific message type from a message structure.\n *\n * This utility type extracts the `response_metadata` property type for a given message type.\n *\n * @template TStructure - The message structure to infer the response metadata from\n * @template TRole - The message type/role to get the response metadata for (e.g., \"ai\", \"human\", \"system\", \"tool\")\n * @returns The type of the response_metadata property, or `Record<string, unknown>` as fallback\n *\n * @example\n * ```ts\n * interface MyStructure extends MessageStructure {\n * properties: {\n * ai: {\n * response_metadata: { model: string; temperature: number; tokens: number };\n * };\n * human: { metadata: Record<string, unknown> };\n * };\n * }\n *\n * type AIResponseMetadata = $InferResponseMetadata<MyStructure, \"ai\">;\n * // AIResponseMetadata = { model: string; temperature: number; tokens: number }\n *\n * type HumanResponseMetadata = $InferResponseMetadata<MyStructure, \"human\">;\n * // HumanResponseMetadata = Record<string, unknown> (fallback since not defined)\n * ```\n */\nexport type $InferResponseMetadata<TStructure extends MessageStructure, TRole extends MessageType> = $InferMessageProperty<TStructure, TRole, \"response_metadata\"> extends infer P ? [P] extends [never] ? Record<string, unknown> : P : never;\n/**\n * Represents a message object that organizes context for an LLM.\n *\n * @example\n * ```ts\n * // Basic message with text content\n * const message: Message = {\n * id: \"msg-123\",\n * name: \"user\",\n * type: \"human\",\n * content: [{ type: \"text\", text: \"Hello!\" }]\n * };\n *\n * // Basic ai message interface extension\n * interface MyMessage extends Message<StandardMessageStructure, \"ai\"> {\n * // Additional AI-specific properties can be added here\n * }\n *`\n * // Custom message structure\n * interface CustomStructure extends MessageStructure {\n * content: {\n * ai: ContentBlock.Text | ContentBlock.ToolCall<\"search\", { query: string }>;\n * human: ContentBlock.Text | ContentBlock.Multimodal.Image;\n * };\n * }\n *\n * // Create a message with custom structure\n * const message: Message<CustomStructure> = {\n * id: \"msg-123\",\n * name: \"user\",\n * type: \"ai\",\n * content: [\n * { type: \"text\", text: \"Hello!\" },\n * {\n * type: \"tool_call\",\n * name: \"search\",\n * args: { query: \"What is the capital of France?\" }\n * }\n * ]\n * };\n * ```\n */\nexport interface Message<TStructure extends MessageStructure = StandardMessageStructure, TRole extends MessageType = MessageType> {\n /** The message type/role */\n readonly type: TRole;\n /** Unique identifier for this message */\n id?: string;\n /** Optional name/identifier for the entity that created this message */\n name?: string;\n /** Array of content blocks that make up the message content */\n content: $InferMessageContent<TStructure, TRole>;\n /** Metadata about the message */\n response_metadata?: Partial<$InferResponseMetadata<TStructure, TRole>>;\n}\n/**\n * Type guard to check if a value is a valid Message object.\n *\n * @param message - The value to check\n * @returns true if the value is a valid Message object, false otherwise\n */\nexport declare function isMessage(message: unknown): message is Message;\nexport {};\n"],"mappings":";;;;;;;;AAkBA;AA4BA;AAgBA;;;;AAEmB;AAoBnB;AA6BA;;;;;AACgBc,KAhGJT,WAAAA,GAgGIS,IAAAA,GAAAA,OAAAA,GAAAA,MAAAA,GAAAA,QAAAA,GAAAA,CAAAA,MAAAA,GAhGyDR,WAgGzDQ,CAAAA,OAAAA,CAAAA,CAAAA;;;;;;;;;;AACE;AA8DlB;;;;;;;;;;AAsBiC;AAGhC;;;;;AAK+C;AA4BpCS,KA7LAhB,oBAAAA,GA6LmB,IAAA,GAAA,IAAA;;;;;;;;;;;;;;;AAA8Q;AAsCjSqB,UAnNKpB,qBAmNkB,CAAA,SAAA,OAAA,EAAA,UAAA,OAAA,CAAA,CAAA;EAAA,KAAA,EAlNxBC,MAkNwB;EAAA,MACnBY,EAlNJX,OAkNIW;;;;;;;;;;;;;;;;;;;;AAA2MC,UA9L1MX,cAAAA,CA8L0MW;EAAO,CAAA,GAA8BE,EAAAA,MAAAA,CAAAA,EA7L7OhB,qBA6L6OgB;;;;;;;;;;;;;;;AAAwF;AAqCxV;;;;;;;;;;;;AAGaI,KAz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I,2BAA2BhC,mBAAmBiB,wCAAwCzB,cAAcA;;iBAElGgC;;;;;;WAMNC,qBAAqBxB,YAAYuB;;sBAEtBnB,QAAQ0B,uBAAuB9B,YAAYuB;;;;;;;;iBAQ3CS,SAAAA,+BAAwCD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.cts","names":["MessageOutputVersion","ResponseMetadata","mergeResponseMetadata","ModalitiesTokenDetails","InputTokenDetails","OutputTokenDetails","UsageMetadata","mergeUsageMetadata"],"sources":["../../src/messages/metadata.d.ts"],"sourcesContent":["import type { MessageOutputVersion } from \"./message.js\";\nexport type ResponseMetadata = {\n model_provider?: string;\n model_name?: string;\n output_version?: MessageOutputVersion;\n [key: string]: unknown;\n};\nexport declare function mergeResponseMetadata(a?: ResponseMetadata, b?: ResponseMetadata): ResponseMetadata;\nexport type ModalitiesTokenDetails = {\n /**\n * Text tokens.\n * Does not need to be reported, but some models will do so.\n */\n text?: number;\n /**\n * Image (non-video) tokens.\n */\n image?: number;\n /**\n * Audio tokens.\n */\n audio?: number;\n /**\n * Video tokens.\n */\n video?: number;\n /**\n * Document tokens.\n * e.g. PDF\n */\n document?: number;\n};\n/**\n * Breakdown of input token counts.\n *\n * Does not *need* to sum to full input token count. Does *not* need to have all keys.\n */\nexport type InputTokenDetails = ModalitiesTokenDetails & {\n /**\n * Input tokens that were cached and there was a cache hit.\n *\n * Since there was a cache hit, the tokens were read from the cache.\n * More precisely, the model state given these tokens was read from the cache.\n */\n cache_read?: number;\n /**\n * Input tokens that were cached and there was a cache miss.\n *\n * Since there was a cache miss, the cache was created from these tokens.\n */\n cache_creation?: number;\n};\n/**\n * Breakdown of output token counts.\n *\n * Does *not* need to sum to full output token count. Does *not* need to have all keys.\n */\nexport type OutputTokenDetails = ModalitiesTokenDetails & {\n /**\n * Reasoning output tokens.\n *\n * Tokens generated by the model in a chain of thought process (i.e. by\n * OpenAI's o1 models) that are not returned as part of model output.\n */\n reasoning?: number;\n};\n/**\n * Usage metadata for a message, such as token counts.\n */\nexport type UsageMetadata = {\n /**\n * Count of input (or prompt) tokens. Sum of all input token types.\n */\n input_tokens: number;\n /**\n * Count of output (or completion) tokens. Sum of all output token types.\n */\n output_tokens: number;\n /**\n * Total token count. Sum of input_tokens + output_tokens.\n */\n total_tokens: number;\n /**\n * Breakdown of input token counts.\n *\n * Does *not* need to sum to full input token count. Does *not* need to have all keys.\n */\n input_token_details?: InputTokenDetails;\n /**\n * Breakdown of output token counts.\n *\n * Does *not* need to sum to full output token count. Does *not* need to have all keys.\n */\n output_token_details?: OutputTokenDetails;\n};\nexport declare function mergeUsageMetadata(a?: UsageMetadata, b?: UsageMetadata): UsageMetadata;\n"],"mappings":";;;KACYC,gBAAAA;;EAAAA,UAAAA,CAAAA,EAAAA,MAAgB;EAMJC,cAAAA,CAAAA,EAHHF,oBAGwB;EAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;CAAA;AAA2BC,iBAAhDC,qBAAAA,CAAgDD,CAAAA,CAAAA,EAAtBA,gBAAsBA,EAAAA,CAAAA,CAAAA,EAAAA,gBAAAA,CAAAA,EAAmBA,gBAAnBA;AAAmBA,KAC/EE,sBAAAA,GAD+EF;EAAgB;AAC3G;AA6BA;AAoBA;EAYYK,IAAAA,CAAAA,EAAAA,MAAAA;EAAa;;;EAwBoB,KAAA,CAAA,EAAA,MAAA;EAErBC;;;EAAoC,KAAMD,CAAAA,EAAAA,MAAAA;EAAa;AAAgB;;;;;;;;;;;;;;KA1DnFF,iBAAAA,GAAoBD;;;;;;;;;;;;;;;;;;;;KAoBpBE,kBAAAA,GAAqBF;;;;;;;;;;;;KAYrBG,aAAAA;;;;;;;;;;;;;;;;;;wBAkBcF;;;;;;yBAMCC;;iBAEHE,kBAAAA,KAAuBD,mBAAmBA,gBAAgBA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","names":["MessageOutputVersion","ResponseMetadata","mergeResponseMetadata","ModalitiesTokenDetails","InputTokenDetails","OutputTokenDetails","UsageMetadata","mergeUsageMetadata"],"sources":["../../src/messages/metadata.d.ts"],"sourcesContent":["import type { MessageOutputVersion } from \"./message.js\";\nexport type ResponseMetadata = {\n model_provider?: string;\n model_name?: string;\n output_version?: MessageOutputVersion;\n [key: string]: unknown;\n};\nexport declare function mergeResponseMetadata(a?: ResponseMetadata, b?: ResponseMetadata): ResponseMetadata;\nexport type ModalitiesTokenDetails = {\n /**\n * Text tokens.\n * Does not need to be reported, but some models will do so.\n */\n text?: number;\n /**\n * Image (non-video) tokens.\n */\n image?: number;\n /**\n * Audio tokens.\n */\n audio?: number;\n /**\n * Video tokens.\n */\n video?: number;\n /**\n * Document tokens.\n * e.g. PDF\n */\n document?: number;\n};\n/**\n * Breakdown of input token counts.\n *\n * Does not *need* to sum to full input token count. Does *not* need to have all keys.\n */\nexport type InputTokenDetails = ModalitiesTokenDetails & {\n /**\n * Input tokens that were cached and there was a cache hit.\n *\n * Since there was a cache hit, the tokens were read from the cache.\n * More precisely, the model state given these tokens was read from the cache.\n */\n cache_read?: number;\n /**\n * Input tokens that were cached and there was a cache miss.\n *\n * Since there was a cache miss, the cache was created from these tokens.\n */\n cache_creation?: number;\n};\n/**\n * Breakdown of output token counts.\n *\n * Does *not* need to sum to full output token count. Does *not* need to have all keys.\n */\nexport type OutputTokenDetails = ModalitiesTokenDetails & {\n /**\n * Reasoning output tokens.\n *\n * Tokens generated by the model in a chain of thought process (i.e. by\n * OpenAI's o1 models) that are not returned as part of model output.\n */\n reasoning?: number;\n};\n/**\n * Usage metadata for a message, such as token counts.\n */\nexport type UsageMetadata = {\n /**\n * Count of input (or prompt) tokens. Sum of all input token types.\n */\n input_tokens: number;\n /**\n * Count of output (or completion) tokens. Sum of all output token types.\n */\n output_tokens: number;\n /**\n * Total token count. Sum of input_tokens + output_tokens.\n */\n total_tokens: number;\n /**\n * Breakdown of input token counts.\n *\n * Does *not* need to sum to full input token count. Does *not* need to have all keys.\n */\n input_token_details?: InputTokenDetails;\n /**\n * Breakdown of output token counts.\n *\n * Does *not* need to sum to full output token count. Does *not* need to have all keys.\n */\n output_token_details?: OutputTokenDetails;\n};\nexport declare function mergeUsageMetadata(a?: UsageMetadata, b?: UsageMetadata): UsageMetadata;\n"],"mappings":";;;KACYC,gBAAAA;;EAAAA,UAAAA,CAAAA,EAAAA,MAAgB;EAMJC,cAAAA,CAAAA,EAHHF,oBAGwB;EAAA,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;CAAA;AAA2BC,iBAAhDC,qBAAAA,CAAgDD,CAAAA,CAAAA,EAAtBA,gBAAsBA,EAAAA,CAAAA,CAAAA,EAAAA,gBAAAA,CAAAA,EAAmBA,gBAAnBA;AAAmBA,KAC/EE,sBAAAA,GAD+EF;EAAgB;AAC3G;AA6BA;AAoBA;EAYYK,IAAAA,CAAAA,EAAAA,MAAAA;EAAa;;;EAwBoB,KAAA,CAAA,EAAA,MAAA;EAErBC;;;EAAoC,KAAMD,CAAAA,EAAAA,MAAAA;EAAa;AAAgB;;;;;;;;;;;;;;KA1DnFF,iBAAAA,GAAoBD;;;;;;;;;;;;;;;;;;;;KAoBpBE,kBAAAA,GAAqBF;;;;;;;;;;;;KAYrBG,aAAAA;;;;;;;;;;;;;;;;;;wBAkBcF;;;;;;yBAMCC;;iBAEHE,kBAAAA,KAAuBD,mBAAmBA,gBAAgBA"}
|
|
@@ -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 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,CAAA;EAAA,qBAAoBH,EAAAA,IAAAA;EAAgB,SAAGA,IAAAA,EAAAA,MAAAA;EAAgB;;;;EAmB/C,MAA3BO,CAAAA,EAAAA,SAAAA,GAAAA,OAAAA;EAAgB,YACNJ,EAAAA,MAAAA;EAAM,QApBoEN,CAAAA,EAnBvFM,MAmBuFN,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA;EAAgB;AAsBtH;;;;;;EAee;EA+CEc,QAAAA,CAAAA,EAAAA,GAAAA;EAmBAC,WAAAA,CAAAA,MAAe,EAhHRb,oBA0HR,CA1H6BG,UA0H7B,EAAA,MAAA,CAAA,GA1HmDD,iBA0HnD,EAAA,YAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAA,MAAA;EAcQY,WAAAA,CAAAA,MAAAA,EAvIAZ,iBAuIqB,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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