@nocobase/plugin-ai 1.9.33 → 1.9.35
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/dist/externalVersion.js +6 -6
- package/dist/node_modules/@langchain/core/dist/caches/base.cjs +28 -5
- package/dist/node_modules/@langchain/core/dist/caches/base.d.ts +13 -1
- package/dist/node_modules/@langchain/core/dist/caches/base.js +25 -2
- package/dist/node_modules/@langchain/core/dist/callbacks/base.cjs +19 -9
- package/dist/node_modules/@langchain/core/dist/callbacks/base.d.ts +37 -22
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/index.cjs +1 -2
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/web.cjs +1 -2
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.cjs +15 -10
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.d.ts +3 -3
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.js +11 -6
- package/dist/node_modules/@langchain/core/dist/embeddings.d.ts +6 -6
- package/dist/node_modules/@langchain/core/dist/errors/index.cjs +1 -2
- package/dist/node_modules/@langchain/core/dist/example_selectors/conditional.cjs +3 -3
- package/dist/node_modules/@langchain/core/dist/index.cjs +3 -0
- package/dist/node_modules/@langchain/core/dist/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/dist/index.js +3 -0
- package/dist/node_modules/@langchain/core/dist/indexing/base.cjs +19 -7
- package/dist/node_modules/@langchain/core/dist/indexing/base.d.ts +3 -0
- package/dist/node_modules/@langchain/core/dist/indexing/base.js +14 -2
- package/dist/node_modules/@langchain/core/dist/language_models/base.cjs +31 -7
- package/dist/node_modules/@langchain/core/dist/language_models/base.d.ts +40 -9
- package/dist/node_modules/@langchain/core/dist/language_models/base.js +29 -5
- package/dist/node_modules/@langchain/core/dist/language_models/chat_models.cjs +37 -10
- package/dist/node_modules/@langchain/core/dist/language_models/chat_models.d.ts +9 -3
- package/dist/node_modules/@langchain/core/dist/language_models/chat_models.js +36 -9
- package/dist/node_modules/@langchain/core/dist/load/import_map.cjs +17 -7
- package/dist/node_modules/@langchain/core/dist/load/index.cjs +18 -9
- package/dist/node_modules/@langchain/core/dist/load/map_keys.cjs +3 -4
- package/dist/node_modules/@langchain/core/dist/load/serializable.cjs +2 -2
- package/dist/node_modules/@langchain/core/dist/memory.cjs +2 -2
- package/dist/node_modules/@langchain/core/dist/messages/ai.cjs +46 -12
- package/dist/node_modules/@langchain/core/dist/messages/ai.d.ts +26 -10
- package/dist/node_modules/@langchain/core/dist/messages/ai.js +43 -9
- package/dist/node_modules/@langchain/core/dist/messages/base.cjs +74 -20
- package/dist/node_modules/@langchain/core/dist/messages/base.d.ts +5 -6
- package/dist/node_modules/@langchain/core/dist/messages/base.js +64 -10
- package/dist/node_modules/@langchain/core/dist/messages/chat.cjs +3 -3
- package/dist/node_modules/@langchain/core/dist/messages/content_blocks.cjs +165 -0
- package/dist/node_modules/@langchain/core/dist/messages/content_blocks.d.ts +151 -0
- package/dist/node_modules/@langchain/core/dist/messages/content_blocks.js +154 -0
- package/dist/node_modules/@langchain/core/dist/messages/function.cjs +3 -3
- package/dist/node_modules/@langchain/core/dist/messages/human.cjs +13 -3
- package/dist/node_modules/@langchain/core/dist/messages/human.d.ts +13 -1
- package/dist/node_modules/@langchain/core/dist/messages/human.js +10 -0
- package/dist/node_modules/@langchain/core/dist/messages/index.cjs +1 -0
- package/dist/node_modules/@langchain/core/dist/messages/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/messages/index.js +1 -0
- package/dist/node_modules/@langchain/core/dist/messages/system.cjs +13 -3
- package/dist/node_modules/@langchain/core/dist/messages/system.d.ts +13 -1
- package/dist/node_modules/@langchain/core/dist/messages/system.js +10 -0
- package/dist/node_modules/@langchain/core/dist/messages/tool.cjs +12 -5
- package/dist/node_modules/@langchain/core/dist/messages/tool.d.ts +13 -5
- package/dist/node_modules/@langchain/core/dist/messages/tool.js +7 -0
- package/dist/node_modules/@langchain/core/dist/messages/transformers.cjs +5 -6
- package/dist/node_modules/@langchain/core/dist/messages/transformers.js +1 -1
- package/dist/node_modules/@langchain/core/dist/messages/utils.cjs +10 -7
- package/dist/node_modules/@langchain/core/dist/messages/utils.js +4 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/json.cjs +7 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/json.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/json.js +7 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +1 -1
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +7 -6
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +19 -5
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.js +3 -2
- package/dist/node_modules/@langchain/core/dist/output_parsers/string.cjs +1 -1
- package/dist/node_modules/@langchain/core/dist/output_parsers/string.d.ts +1 -1
- package/dist/node_modules/@langchain/core/dist/output_parsers/string.js +1 -1
- package/dist/node_modules/@langchain/core/dist/output_parsers/structured.cjs +17 -11
- package/dist/node_modules/@langchain/core/dist/output_parsers/structured.d.ts +10 -9
- package/dist/node_modules/@langchain/core/dist/output_parsers/structured.js +15 -9
- package/dist/node_modules/@langchain/core/dist/output_parsers/xml.cjs +2 -2
- package/dist/node_modules/@langchain/core/dist/prompts/base.cjs +36 -3
- package/dist/node_modules/@langchain/core/dist/prompts/chat.cjs +72 -24
- package/dist/node_modules/@langchain/core/dist/prompts/chat.d.ts +5 -4
- package/dist/node_modules/@langchain/core/dist/prompts/chat.js +72 -24
- package/dist/node_modules/@langchain/core/dist/prompts/dict.cjs +114 -0
- package/dist/node_modules/@langchain/core/dist/prompts/dict.d.ts +18 -0
- package/dist/node_modules/@langchain/core/dist/prompts/dict.js +110 -0
- package/dist/node_modules/@langchain/core/dist/prompts/index.cjs +1 -0
- package/dist/node_modules/@langchain/core/dist/prompts/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/prompts/index.js +1 -0
- package/dist/node_modules/@langchain/core/dist/prompts/structured.cjs +16 -6
- package/dist/node_modules/@langchain/core/dist/prompts/structured.d.ts +3 -1
- package/dist/node_modules/@langchain/core/dist/prompts/structured.js +16 -6
- package/dist/node_modules/@langchain/core/dist/prompts/template.cjs +24 -13
- package/dist/node_modules/@langchain/core/dist/prompts/template.js +24 -13
- package/dist/node_modules/@langchain/core/dist/runnables/base.cjs +81 -38
- package/dist/node_modules/@langchain/core/dist/runnables/base.d.ts +44 -18
- package/dist/node_modules/@langchain/core/dist/runnables/base.js +74 -31
- package/dist/node_modules/@langchain/core/dist/runnables/config.cjs +6 -6
- package/dist/node_modules/@langchain/core/dist/runnables/graph.cjs +2 -2
- package/dist/node_modules/@langchain/core/dist/runnables/graph.js +2 -2
- package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.cjs +29 -6
- package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.d.ts +25 -1
- package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.js +26 -3
- package/dist/node_modules/@langchain/core/dist/runnables/iter.cjs +5 -5
- package/dist/node_modules/@langchain/core/dist/runnables/iter.d.ts +1 -1
- package/dist/node_modules/@langchain/core/dist/runnables/passthrough.cjs +1 -1
- package/dist/node_modules/@langchain/core/dist/runnables/passthrough.d.ts +1 -1
- package/dist/node_modules/@langchain/core/dist/runnables/passthrough.js +1 -1
- package/dist/node_modules/@langchain/core/dist/runnables/remote.cjs +2 -0
- package/dist/node_modules/@langchain/core/dist/runnables/remote.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/runnables/remote.js +2 -0
- package/dist/node_modules/@langchain/core/dist/runnables/types.d.ts +2 -2
- package/dist/node_modules/@langchain/core/dist/runnables/utils.cjs +2 -2
- package/dist/node_modules/@langchain/core/dist/runnables/wrappers.cjs +1 -2
- package/dist/node_modules/@langchain/core/dist/runnables/wrappers.d.ts +1 -1
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/context.cjs +3 -3
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/index.cjs +1 -1
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/index.js +1 -1
- package/dist/node_modules/@langchain/core/dist/singletons/callbacks.cjs +10 -6
- package/dist/node_modules/@langchain/core/dist/singletons/callbacks.d.ts +1 -1
- package/dist/node_modules/@langchain/core/dist/singletons/callbacks.js +7 -2
- package/dist/node_modules/@langchain/core/dist/structured_query/utils.cjs +7 -8
- package/dist/node_modules/@langchain/core/dist/tools/index.cjs +99 -45
- package/dist/node_modules/@langchain/core/dist/tools/index.d.ts +51 -151
- package/dist/node_modules/@langchain/core/dist/tools/index.js +94 -44
- package/dist/node_modules/@langchain/core/dist/tools/types.cjs +64 -0
- package/dist/node_modules/@langchain/core/dist/tools/types.d.ts +272 -0
- package/dist/node_modules/@langchain/core/dist/tools/types.js +58 -0
- package/dist/node_modules/@langchain/core/dist/tools/utils.cjs +12 -2
- package/dist/node_modules/@langchain/core/dist/tools/utils.d.ts +5 -0
- package/dist/node_modules/@langchain/core/dist/tools/utils.js +9 -0
- package/dist/node_modules/@langchain/core/dist/tracers/base.cjs +96 -32
- package/dist/node_modules/@langchain/core/dist/tracers/base.d.ts +104 -84
- package/dist/node_modules/@langchain/core/dist/tracers/base.js +94 -30
- package/dist/node_modules/@langchain/core/dist/tracers/initialize.cjs +2 -3
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.cjs +39 -75
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.d.ts +6 -4
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.js +39 -75
- package/dist/node_modules/@langchain/core/dist/utils/async_caller.cjs +9 -9
- package/dist/node_modules/@langchain/core/dist/utils/async_caller.js +9 -9
- package/dist/node_modules/@langchain/core/dist/utils/env.cjs +11 -6
- package/dist/node_modules/@langchain/core/dist/utils/env.d.ts +4 -0
- package/dist/node_modules/@langchain/core/dist/utils/env.js +7 -3
- package/dist/node_modules/@langchain/core/dist/utils/event_source_parse.cjs +5 -5
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/index.cjs +17 -7
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/index.d.ts +4 -4
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.cjs +8 -8
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/duplex.cjs +4 -5
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.cjs +10 -10
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.d.ts +3 -3
- package/dist/node_modules/@langchain/core/dist/utils/function_calling.cjs +20 -72
- package/dist/node_modules/@langchain/core/dist/utils/function_calling.d.ts +8 -38
- package/dist/node_modules/@langchain/core/dist/utils/function_calling.js +12 -64
- package/dist/node_modules/@langchain/core/dist/utils/hash.cjs +3 -1
- package/dist/node_modules/@langchain/core/dist/utils/hash.d.ts +7 -0
- package/dist/node_modules/@langchain/core/dist/utils/hash.js +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.cjs +17 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.d.ts +4 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.js +17 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha256/hash.cjs +448 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha256/hash.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha256/hash.js +445 -0
- package/dist/node_modules/@langchain/core/dist/utils/json.cjs +19 -7
- package/dist/node_modules/@langchain/core/dist/utils/json.js +17 -4
- package/dist/node_modules/@langchain/core/dist/utils/json_schema.cjs +95 -3
- package/dist/node_modules/@langchain/core/dist/utils/json_schema.d.ts +18 -0
- package/dist/node_modules/@langchain/core/dist/utils/json_schema.js +90 -0
- package/dist/node_modules/@langchain/core/dist/utils/math.cjs +6 -7
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/distances.cjs +1 -2
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/similarities.cjs +1 -2
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance-euclidean/euclidean.cjs +2 -3
- package/dist/node_modules/@langchain/core/dist/utils/sax-js/sax.cjs +35 -35
- package/dist/node_modules/@langchain/core/dist/utils/sax-js/sax.js +35 -35
- package/dist/node_modules/@langchain/core/dist/utils/signal.cjs +1 -2
- package/dist/node_modules/@langchain/core/dist/utils/stream.cjs +4 -4
- package/dist/node_modules/@langchain/core/dist/utils/testing/helpers.cjs +7 -0
- package/dist/node_modules/@langchain/core/dist/utils/testing/helpers.d.ts +3 -0
- package/dist/node_modules/@langchain/core/dist/utils/testing/helpers.js +3 -0
- package/dist/node_modules/@langchain/core/dist/utils/testing/index.cjs +109 -24
- package/dist/node_modules/@langchain/core/dist/utils/testing/index.d.ts +43 -16
- package/dist/node_modules/@langchain/core/dist/utils/testing/index.js +109 -24
- package/dist/node_modules/@langchain/core/dist/utils/tiktoken.cjs +2 -3
- package/dist/node_modules/@langchain/core/dist/utils/types/index.cjs +1 -1
- package/dist/node_modules/@langchain/core/dist/utils/types/index.d.ts +1 -1
- package/dist/node_modules/@langchain/core/dist/utils/types/index.js +1 -1
- package/dist/node_modules/@langchain/core/dist/utils/types/zod.cjs +619 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/zod.d.ts +212 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/zod.js +595 -0
- package/dist/node_modules/@langchain/core/index.cjs +1 -1
- package/dist/node_modules/@langchain/core/index.d.cts +3 -0
- package/dist/node_modules/@langchain/core/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/README.md +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/anonymizer/index.cjs +1 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.cjs +1153 -542
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.d.ts +157 -18
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.js +1136 -535
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_random_name.cjs +1 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_runner.cjs +6 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_runner.js +5 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.cjs +7 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.js +6 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluator.cjs +8 -4
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluator.js +6 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/langchain.cjs +1 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/constants.cjs +60 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/constants.d.ts +49 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/constants.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/exporter.cjs +222 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/exporter.d.ts +60 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/exporter.js +185 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/processor.cjs +90 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/processor.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/processor.js +85 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/setup.cjs +93 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/setup.d.ts +64 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/setup.js +89 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/translator.cjs +447 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/translator.d.ts +22 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/translator.js +410 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/types.cjs +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/types.d.ts +29 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/types.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/utils.cjs +23 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/utils.d.ts +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/otel/utils.js +19 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/index.cjs +439 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/index.d.ts +240 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/index.js +435 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/middleware.cjs +235 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/middleware.d.ts +27 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/middleware.js +232 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/utils.cjs +170 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/utils.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/experimental/vercel/utils.js +165 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.cjs +4 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.d.ts +2 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.js +2 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.cjs +70 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.d.ts +182 -60
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.js +70 -4
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.cjs +6 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.cjs +350 -63
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.d.ts +35 -8
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.js +324 -47
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/schemas.d.ts +32 -5
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.cjs +30 -4
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.js +27 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/otel.cjs +155 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/otel.d.ts +63 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/otel.js +147 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.cjs +8 -19
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.d.ts +7 -5
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.js +4 -15
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.js +1 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.cjs +250 -64
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.d.ts +21 -18
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.js +249 -63
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.cjs +6 -27
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.js +5 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/asserts.cjs +3 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/asserts.d.ts +3 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.cjs +16 -28
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.d.ts +1 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.js +16 -28
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/atee.cjs +1 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.cjs +48 -62
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.d.ts +8 -18
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.js +39 -53
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.cjs +68 -10
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.d.ts +7 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.js +63 -7
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs +54 -6
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.d.ts +1 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js +53 -4
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/globals.cjs +3 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/globals.d.ts +2 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.cjs +170 -70
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.d.ts +79 -67
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.js +148 -58
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/matchers.cjs +3 -4
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/reporter.cjs +18 -9
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/types.d.ts +19 -4
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/chain.cjs +1 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/chain.d.ts +0 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/evaluatedBy.cjs +13 -7
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/evaluatedBy.js +12 -5
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/messages.cjs +2 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/project.cjs +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/project.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/project.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/prompts.cjs +2 -3
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/shuffle.cjs +1 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/vercel.cjs +155 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/vercel.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/vercel.js +150 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/warn.cjs +1 -2
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.cjs +277 -84
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.d.ts +17 -5
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.js +275 -83
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.cjs +11 -9
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.d.mts +392 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.d.ts +73 -116
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.js +8 -7
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.mjs +324 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.cjs +2 -17
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.d.mts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.js +2 -17
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.mjs +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/esm.d.mts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/esm.mjs +38 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/reporter.cjs +25 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/reporter.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/reporter.js +21 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/wrapper.cjs +63 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/wrapper.d.ts +167 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/utils/wrapper.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.cjs +162 -90
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.d.ts +10 -11
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.js +163 -91
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/exporter.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/processor.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/otel/setup.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/experimental/vercel.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/package.json +84 -14
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.d.ts +1 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.js +1 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.d.ts +1 -1
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.js +1 -1
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/index.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/ZodError.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/datetime.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/discriminatedUnion.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/index.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/ipv4.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/object.js +70 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/primitives.js +159 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/realworld.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/string.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/benchmarks/union.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/errors.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/external.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/enumUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/errorUtil.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/parseUtil.js +124 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/partialUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/typeAliases.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/helpers/util.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/locales/en.js +109 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/tests/Mocker.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v3/types.js +3773 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/checks.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/coerce.js +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/compat.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/errors.js +67 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/external.js +69 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/iso.js +60 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/parse.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/classic/schemas.js +1100 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/api.js +1021 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/checks.js +580 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/config.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/core.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/doc.js +39 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/errors.js +222 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/function.js +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/index.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/json-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/parse.js +87 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/regexes.js +103 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/registries.js +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/schemas.js +1719 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/to-json-schema.js +833 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/util.js +537 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/versions.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/core/zsf.js +172 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/index.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ar.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/az.js +141 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/be.js +190 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ca.js +144 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/cs.js +161 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/de.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/en.js +145 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/es.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fa.js +148 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fi.js +148 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fr-CA.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/fr.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/he.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/hu.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/id.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/index.js +82 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/it.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ja.js +141 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/kh.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ko.js +147 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/mk.js +144 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ms.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/nl.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/no.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ota.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/pl.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ps.js +148 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/pt.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ru.js +190 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/sl.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/sv.js +144 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ta.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/th.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/tr.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ua.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/ur.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/vi.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/zh-CN.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/locales/zh-TW.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/checks.js +34 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/coerce.js +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/external.js +61 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/index.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/iso.js +60 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/parse.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/cjs/v4/mini/schemas.js +831 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/ZodError.js +132 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/datetime.js +49 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js +74 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/index.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/ipv4.js +49 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/object.js +65 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/primitives.js +154 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/realworld.js +51 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/string.js +50 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/benchmarks/union.js +74 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/errors.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/external.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/enumUtil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/errorUtil.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/parseUtil.js +109 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/partialUtil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/typeAliases.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/helpers/util.js +133 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/index.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/locales/en.js +107 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/standard-schema.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/tests/Mocker.js +53 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v3/types.js +3691 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/checks.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/coerce.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/compat.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/errors.js +41 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/external.js +18 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/index.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/iso.js +30 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/parse.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/classic/schemas.js +998 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/api.js +889 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/checks.js +554 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/config.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/core.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/doc.js +35 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/errors.js +191 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/function.js +75 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/index.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/json-schema.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/parse.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/regexes.js +95 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/registries.js +42 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/schemas.js +1688 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/standard-schema.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/to-json-schema.js +828 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/util.js +491 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/versions.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/core/zsf.js +171 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ar.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/az.js +115 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/be.js +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ca.js +118 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/cs.js +135 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/de.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/en.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/es.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fa.js +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fi.js +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fr-CA.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/fr.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/he.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/hu.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/id.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/index.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/it.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ja.js +115 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/kh.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ko.js +121 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/mk.js +118 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ms.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/nl.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/no.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ota.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/pl.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ps.js +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/pt.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ru.js +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/sl.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/sv.js +118 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ta.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/th.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/tr.js +115 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ua.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/ur.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/vi.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/zh-CN.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/locales/zh-TW.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/checks.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/coerce.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/external.js +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/iso.js +30 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/parse.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/esm/v4/mini/schemas.js +725 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/ZodError.d.ts +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/datetime.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/discriminatedUnion.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/ipv4.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/object.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/primitives.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/realworld.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/string.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/benchmarks/union.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/errors.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/external.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/enumUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/errorUtil.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/parseUtil.d.ts +78 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/partialUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/typeAliases.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/helpers/util.d.ts +85 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/locales/en.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/standard-schema.d.ts +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/tests/Mocker.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v3/types.d.ts +1031 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/checks.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/coerce.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/compat.d.ts +48 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/errors.d.ts +30 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/external.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/iso.d.ts +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/parse.d.ts +23 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/classic/schemas.d.ts +624 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/api.d.ts +281 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/checks.d.ts +277 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/config.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/core.d.ts +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/doc.d.ts +14 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/errors.d.ts +204 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/function.d.ts +52 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/index.d.ts +15 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/json-schema.d.ts +87 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/parse.d.ts +25 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/regexes.d.ts +62 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/registries.d.ts +39 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/schemas.d.ts +1005 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/util.d.ts +183 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/versions.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/core/zsf.d.ts +91 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ar.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/az.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/be.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ca.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/cs.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/de.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/en.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/es.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fa.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fi.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fr-CA.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/fr.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/he.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/hu.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/id.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/index.d.ts +38 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/it.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ja.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/kh.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ko.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/mk.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ms.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/nl.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/no.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ota.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/pl.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ps.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/pt.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ru.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/sl.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/sv.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ta.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/th.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/tr.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ua.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/ur.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/vi.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/zh-CN.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/checks.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/coerce.d.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/external.d.ts +11 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/iso.d.ts +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/parse.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/dist/types/v4/mini/schemas.d.ts +351 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v3/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v3/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/core/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/core/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/en.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/en.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4/locales/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/v4-mini/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/LICENSE +21 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/README.md +208 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/index.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/ZodError.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/datetime.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/discriminatedUnion.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/index.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/ipv4.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/object.js +70 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/primitives.js +159 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/realworld.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/string.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/benchmarks/union.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/errors.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/external.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/enumUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/errorUtil.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/parseUtil.js +124 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/partialUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/typeAliases.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/helpers/util.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/locales/en.js +109 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/tests/Mocker.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v3/types.js +3773 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/checks.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/coerce.js +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/compat.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/errors.js +67 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/external.js +69 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/iso.js +60 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/parse.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/classic/schemas.js +1100 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/api.js +1021 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/checks.js +580 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/config.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/core.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/doc.js +39 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/errors.js +222 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/function.js +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/index.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/json-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/parse.js +87 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/regexes.js +103 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/registries.js +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/schemas.js +1719 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/to-json-schema.js +833 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/util.js +537 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/versions.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/core/zsf.js +172 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/index.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ar.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/az.js +141 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/be.js +190 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ca.js +144 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/cs.js +161 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/de.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/en.js +145 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/es.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fa.js +148 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fi.js +148 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fr-CA.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/fr.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/he.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/hu.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/id.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/index.js +82 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/it.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ja.js +141 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/kh.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ko.js +147 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/mk.js +144 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ms.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/nl.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/no.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ota.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/pl.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ps.js +148 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/pt.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ru.js +190 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/sl.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/sv.js +144 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ta.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/th.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/tr.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ua.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/ur.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/vi.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/zh-CN.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/locales/zh-TW.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/checks.js +34 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/coerce.js +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/external.js +61 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/index.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/iso.js +60 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/parse.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/cjs/v4/mini/schemas.js +831 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/ZodError.js +132 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/datetime.js +49 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/discriminatedUnion.js +74 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/index.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/ipv4.js +49 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/object.js +65 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/primitives.js +154 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/realworld.js +51 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/string.js +50 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/benchmarks/union.js +74 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/errors.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/external.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/enumUtil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/errorUtil.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/parseUtil.js +109 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/partialUtil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/typeAliases.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/helpers/util.js +133 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/index.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/locales/en.js +107 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/standard-schema.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/tests/Mocker.js +53 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v3/types.js +3691 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/checks.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/coerce.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/compat.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/errors.js +41 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/external.js +18 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/index.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/iso.js +30 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/parse.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/classic/schemas.js +998 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/api.js +889 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/checks.js +554 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/config.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/core.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/doc.js +35 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/errors.js +191 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/function.js +75 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/index.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/json-schema.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/parse.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/regexes.js +95 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/registries.js +42 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/schemas.js +1688 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/standard-schema.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/to-json-schema.js +828 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/util.js +491 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/versions.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/core/zsf.js +171 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ar.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/az.js +115 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/be.js +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ca.js +118 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/cs.js +135 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/de.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/en.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/es.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fa.js +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fi.js +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fr-CA.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/fr.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/he.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/hu.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/id.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/index.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/it.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ja.js +115 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/kh.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ko.js +121 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/mk.js +118 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ms.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/nl.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/no.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ota.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/pl.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ps.js +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/pt.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ru.js +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/sl.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/sv.js +118 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ta.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/th.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/tr.js +115 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ua.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/ur.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/vi.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/zh-CN.js +116 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/locales/zh-TW.js +117 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/checks.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/coerce.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/external.js +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/iso.js +30 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/parse.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/esm/v4/mini/schemas.js +725 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/ZodError.d.ts +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/datetime.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/discriminatedUnion.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/ipv4.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/object.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/primitives.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/realworld.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/string.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/benchmarks/union.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/errors.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/external.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/enumUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/errorUtil.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/parseUtil.d.ts +78 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/partialUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/typeAliases.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/helpers/util.d.ts +85 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/locales/en.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/standard-schema.d.ts +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/tests/Mocker.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v3/types.d.ts +1031 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/checks.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/coerce.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/compat.d.ts +48 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/errors.d.ts +30 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/external.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/iso.d.ts +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/parse.d.ts +23 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/classic/schemas.d.ts +624 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/api.d.ts +281 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/checks.d.ts +277 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/config.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/core.d.ts +47 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/doc.d.ts +14 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/errors.d.ts +204 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/function.d.ts +52 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/index.d.ts +15 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/json-schema.d.ts +87 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/parse.d.ts +25 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/regexes.d.ts +62 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/registries.d.ts +39 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/schemas.d.ts +1005 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/standard-schema.d.ts +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/to-json-schema.d.ts +84 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/util.d.ts +183 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/versions.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/core/zsf.d.ts +91 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ar.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/az.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/be.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ca.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/cs.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/de.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/en.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/es.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fa.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fi.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fr-CA.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/fr.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/he.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/hu.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/id.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/index.d.ts +38 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/it.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ja.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/kh.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ko.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/mk.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ms.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/nl.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/no.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ota.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/pl.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ps.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/pt.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ru.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/sl.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/sv.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ta.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/th.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/tr.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ua.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/ur.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/vi.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/zh-CN.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/locales/zh-TW.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/checks.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/coerce.d.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/external.d.ts +11 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/iso.d.ts +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/parse.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/dist/types/v4/mini/schemas.d.ts +351 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/package.json +120 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v3/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v3/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/core/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/core/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/index.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/en.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/en.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4/locales/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/node_modules/zod/v4-mini/index.js +1 -0
- package/dist/node_modules/@langchain/core/package.json +1 -1
- package/dist/node_modules/@langchain/core/utils/hash/insecure.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/hash/insecure.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/hash/insecure.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/hash/insecure.js +1 -0
- package/dist/node_modules/@langchain/core/utils/hash/sha256.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/hash/sha256.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/hash/sha256.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/hash/sha256.js +1 -0
- package/dist/node_modules/@langchain/deepseek/index.cjs +18 -10
- package/dist/node_modules/@langchain/deepseek/package.json +1 -1
- package/dist/node_modules/@langchain/openai/dist/chat_models.cjs +527 -11
- package/dist/node_modules/@langchain/openai/dist/chat_models.d.ts +46 -5
- package/dist/node_modules/@langchain/openai/dist/chat_models.js +528 -12
- package/dist/node_modules/@langchain/openai/dist/llms.cjs +1 -1
- package/dist/node_modules/@langchain/openai/dist/llms.js +1 -1
- package/dist/node_modules/@langchain/openai/dist/types.d.ts +1 -1
- package/dist/node_modules/@langchain/openai/index.cjs +18 -10
- package/dist/node_modules/@langchain/openai/package.json +1 -1
- package/package.json +2 -2
- package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.cjs +0 -16
- package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.d.ts +0 -8
- package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.js +0 -12
- /package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/{vercel.types.cjs → utils/vercel.types.cjs} +0 -0
- /package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/{vercel.types.d.ts → utils/vercel.types.d.ts} +0 -0
- /package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/{vercel.types.js → utils/vercel.types.js} +0 -0
|
@@ -15,16 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Client = exports.
|
|
36
|
+
exports.Client = exports.DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES = exports.AutoBatchQueue = void 0;
|
|
37
|
+
exports.mergeRuntimeEnvIntoRun = mergeRuntimeEnvIntoRun;
|
|
27
38
|
const uuid = __importStar(require("uuid"));
|
|
39
|
+
const translator_js_1 = require("./experimental/otel/translator.cjs");
|
|
40
|
+
const otel_js_1 = require("./singletons/otel.cjs");
|
|
28
41
|
const async_caller_js_1 = require("./utils/async_caller.cjs");
|
|
29
42
|
const messages_js_1 = require("./utils/messages.cjs");
|
|
30
43
|
const env_js_1 = require("./utils/env.cjs");
|
|
@@ -35,9 +48,9 @@ const prompts_js_1 = require("./utils/prompts.cjs");
|
|
|
35
48
|
const error_js_1 = require("./utils/error.cjs");
|
|
36
49
|
const fetch_js_1 = require("./singletons/fetch.cjs");
|
|
37
50
|
const index_js_2 = require("./utils/fast-safe-stringify/index.cjs");
|
|
38
|
-
function
|
|
51
|
+
function mergeRuntimeEnvIntoRun(run, cachedEnvVars) {
|
|
39
52
|
const runtimeEnv = (0, env_js_1.getRuntimeEnvironment)();
|
|
40
|
-
const envVars = (0, env_js_1.
|
|
53
|
+
const envVars = cachedEnvVars ?? (0, env_js_1.getLangSmithEnvVarsMetadata)();
|
|
41
54
|
const extra = run.extra ?? {};
|
|
42
55
|
const metadata = extra.metadata;
|
|
43
56
|
run.extra = {
|
|
@@ -48,17 +61,20 @@ function mergeRuntimeEnvIntoRunCreate(run) {
|
|
|
48
61
|
},
|
|
49
62
|
metadata: {
|
|
50
63
|
...envVars,
|
|
51
|
-
...(envVars.revision_id || run.revision_id
|
|
52
|
-
? {
|
|
64
|
+
...(envVars.revision_id || ("revision_id" in run && run.revision_id)
|
|
65
|
+
? {
|
|
66
|
+
revision_id: ("revision_id" in run ? run.revision_id : undefined) ??
|
|
67
|
+
envVars.revision_id,
|
|
68
|
+
}
|
|
53
69
|
: {}),
|
|
54
70
|
...metadata,
|
|
55
71
|
},
|
|
56
72
|
};
|
|
57
73
|
return run;
|
|
58
74
|
}
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
75
|
+
const getTracingSamplingRate = (configRate) => {
|
|
76
|
+
const samplingRateStr = configRate?.toString() ??
|
|
77
|
+
(0, env_js_1.getLangSmithEnvironmentVariable)("TRACING_SAMPLING_RATE");
|
|
62
78
|
if (samplingRateStr === undefined) {
|
|
63
79
|
return undefined;
|
|
64
80
|
}
|
|
@@ -92,7 +108,7 @@ function trimQuotes(str) {
|
|
|
92
108
|
}
|
|
93
109
|
const handle429 = async (response) => {
|
|
94
110
|
if (response?.status === 429) {
|
|
95
|
-
const retryAfter = parseInt(response.headers.get("retry-after") ?? "
|
|
111
|
+
const retryAfter = parseInt(response.headers.get("retry-after") ?? "10", 10) * 1000;
|
|
96
112
|
if (retryAfter > 0) {
|
|
97
113
|
await new Promise((resolve) => setTimeout(resolve, retryAfter));
|
|
98
114
|
// Return directly after calling this check
|
|
@@ -102,6 +118,13 @@ const handle429 = async (response) => {
|
|
|
102
118
|
// Fall back to existing status checks
|
|
103
119
|
return false;
|
|
104
120
|
};
|
|
121
|
+
function _formatFeedbackScore(score) {
|
|
122
|
+
if (typeof score === "number") {
|
|
123
|
+
// Truncate at 4 decimal places
|
|
124
|
+
return Number(score.toFixed(4));
|
|
125
|
+
}
|
|
126
|
+
return score;
|
|
127
|
+
}
|
|
105
128
|
class AutoBatchQueue {
|
|
106
129
|
constructor() {
|
|
107
130
|
Object.defineProperty(this, "items", {
|
|
@@ -127,10 +150,13 @@ class AutoBatchQueue {
|
|
|
127
150
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise
|
|
128
151
|
itemPromiseResolve = resolve;
|
|
129
152
|
});
|
|
130
|
-
const size = (0, index_js_2.serialize)(item.item).length;
|
|
153
|
+
const size = (0, index_js_2.serialize)(item.item, `Serializing run with id: ${item.item.id}`).length;
|
|
131
154
|
this.items.push({
|
|
132
155
|
action: item.action,
|
|
133
156
|
payload: item.item,
|
|
157
|
+
otelContext: item.otelContext,
|
|
158
|
+
apiKey: item.apiKey,
|
|
159
|
+
apiUrl: item.apiUrl,
|
|
134
160
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
135
161
|
itemPromiseResolve: itemPromiseResolve,
|
|
136
162
|
itemPromise,
|
|
@@ -139,7 +165,7 @@ class AutoBatchQueue {
|
|
|
139
165
|
this.sizeBytes += size;
|
|
140
166
|
return itemPromise;
|
|
141
167
|
}
|
|
142
|
-
pop(upToSizeBytes) {
|
|
168
|
+
pop({ upToSizeBytes, upToSize, }) {
|
|
143
169
|
if (upToSizeBytes < 1) {
|
|
144
170
|
throw new Error("Number of bytes to pop off may not be less than 1.");
|
|
145
171
|
}
|
|
@@ -147,7 +173,8 @@ class AutoBatchQueue {
|
|
|
147
173
|
let poppedSizeBytes = 0;
|
|
148
174
|
// Pop items until we reach or exceed the size limit
|
|
149
175
|
while (poppedSizeBytes + (this.peek()?.size ?? 0) < upToSizeBytes &&
|
|
150
|
-
this.items.length > 0
|
|
176
|
+
this.items.length > 0 &&
|
|
177
|
+
popped.length < upToSize) {
|
|
151
178
|
const item = this.items.shift();
|
|
152
179
|
if (item) {
|
|
153
180
|
popped.push(item);
|
|
@@ -164,16 +191,27 @@ class AutoBatchQueue {
|
|
|
164
191
|
this.sizeBytes -= item.size;
|
|
165
192
|
}
|
|
166
193
|
return [
|
|
167
|
-
popped.map((it) => ({
|
|
194
|
+
popped.map((it) => ({
|
|
195
|
+
action: it.action,
|
|
196
|
+
item: it.payload,
|
|
197
|
+
otelContext: it.otelContext,
|
|
198
|
+
apiKey: it.apiKey,
|
|
199
|
+
apiUrl: it.apiUrl,
|
|
200
|
+
})),
|
|
168
201
|
() => popped.forEach((it) => it.itemPromiseResolve()),
|
|
169
202
|
];
|
|
170
203
|
}
|
|
171
204
|
}
|
|
172
205
|
exports.AutoBatchQueue = AutoBatchQueue;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
206
|
+
exports.DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES = 24 * 1024 * 1024;
|
|
207
|
+
const SERVER_INFO_REQUEST_TIMEOUT_MS = 10000;
|
|
208
|
+
/** Maximum number of operations to batch in a single request. */
|
|
209
|
+
const DEFAULT_BATCH_SIZE_LIMIT = 100;
|
|
210
|
+
const DEFAULT_API_URL = "https://api.smith.langchain.com";
|
|
176
211
|
class Client {
|
|
212
|
+
get _fetch() {
|
|
213
|
+
return this.fetchImplementation || (0, fetch_js_1._getFetchImplementation)(this.debug);
|
|
214
|
+
}
|
|
177
215
|
constructor(config = {}) {
|
|
178
216
|
Object.defineProperty(this, "apiKey", {
|
|
179
217
|
enumerable: true,
|
|
@@ -193,6 +231,12 @@ class Client {
|
|
|
193
231
|
writable: true,
|
|
194
232
|
value: void 0
|
|
195
233
|
});
|
|
234
|
+
Object.defineProperty(this, "workspaceId", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
configurable: true,
|
|
237
|
+
writable: true,
|
|
238
|
+
value: void 0
|
|
239
|
+
});
|
|
196
240
|
Object.defineProperty(this, "caller", {
|
|
197
241
|
enumerable: true,
|
|
198
242
|
configurable: true,
|
|
@@ -271,6 +315,12 @@ class Client {
|
|
|
271
315
|
writable: true,
|
|
272
316
|
value: void 0
|
|
273
317
|
});
|
|
318
|
+
Object.defineProperty(this, "batchSizeLimit", {
|
|
319
|
+
enumerable: true,
|
|
320
|
+
configurable: true,
|
|
321
|
+
writable: true,
|
|
322
|
+
value: void 0
|
|
323
|
+
});
|
|
274
324
|
Object.defineProperty(this, "fetchOptions", {
|
|
275
325
|
enumerable: true,
|
|
276
326
|
configurable: true,
|
|
@@ -314,8 +364,38 @@ class Client {
|
|
|
314
364
|
writable: true,
|
|
315
365
|
value: false
|
|
316
366
|
});
|
|
367
|
+
Object.defineProperty(this, "langSmithToOTELTranslator", {
|
|
368
|
+
enumerable: true,
|
|
369
|
+
configurable: true,
|
|
370
|
+
writable: true,
|
|
371
|
+
value: void 0
|
|
372
|
+
});
|
|
373
|
+
Object.defineProperty(this, "fetchImplementation", {
|
|
374
|
+
enumerable: true,
|
|
375
|
+
configurable: true,
|
|
376
|
+
writable: true,
|
|
377
|
+
value: void 0
|
|
378
|
+
});
|
|
379
|
+
Object.defineProperty(this, "cachedLSEnvVarsForMetadata", {
|
|
380
|
+
enumerable: true,
|
|
381
|
+
configurable: true,
|
|
382
|
+
writable: true,
|
|
383
|
+
value: void 0
|
|
384
|
+
});
|
|
385
|
+
Object.defineProperty(this, "multipartStreamingDisabled", {
|
|
386
|
+
enumerable: true,
|
|
387
|
+
configurable: true,
|
|
388
|
+
writable: true,
|
|
389
|
+
value: false
|
|
390
|
+
});
|
|
391
|
+
Object.defineProperty(this, "debug", {
|
|
392
|
+
enumerable: true,
|
|
393
|
+
configurable: true,
|
|
394
|
+
writable: true,
|
|
395
|
+
value: (0, env_js_1.getEnvironmentVariable)("LANGSMITH_DEBUG") === "true"
|
|
396
|
+
});
|
|
317
397
|
const defaultConfig = Client.getDefaultClientConfig();
|
|
318
|
-
this.tracingSampleRate = getTracingSamplingRate();
|
|
398
|
+
this.tracingSampleRate = getTracingSamplingRate(config.tracingSamplingRate);
|
|
319
399
|
this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? "";
|
|
320
400
|
if (this.apiUrl.endsWith("/")) {
|
|
321
401
|
this.apiUrl = this.apiUrl.slice(0, -1);
|
|
@@ -325,18 +405,26 @@ class Client {
|
|
|
325
405
|
if (this.webUrl?.endsWith("/")) {
|
|
326
406
|
this.webUrl = this.webUrl.slice(0, -1);
|
|
327
407
|
}
|
|
408
|
+
this.workspaceId = trimQuotes(config.workspaceId ?? (0, env_js_1.getLangSmithEnvironmentVariable)("WORKSPACE_ID"));
|
|
328
409
|
this.timeout_ms = config.timeout_ms ?? 90_000;
|
|
329
|
-
this.caller = new async_caller_js_1.AsyncCaller(
|
|
410
|
+
this.caller = new async_caller_js_1.AsyncCaller({
|
|
411
|
+
...(config.callerOptions ?? {}),
|
|
412
|
+
maxRetries: 4,
|
|
413
|
+
debug: config.debug ?? this.debug,
|
|
414
|
+
});
|
|
330
415
|
this.traceBatchConcurrency =
|
|
331
416
|
config.traceBatchConcurrency ?? this.traceBatchConcurrency;
|
|
332
417
|
if (this.traceBatchConcurrency < 1) {
|
|
333
418
|
throw new Error("Trace batch concurrency must be positive.");
|
|
334
419
|
}
|
|
420
|
+
this.debug = config.debug ?? this.debug;
|
|
421
|
+
this.fetchImplementation = config.fetchImplementation;
|
|
335
422
|
this.batchIngestCaller = new async_caller_js_1.AsyncCaller({
|
|
336
423
|
maxRetries: 2,
|
|
337
424
|
maxConcurrency: this.traceBatchConcurrency,
|
|
338
425
|
...(config.callerOptions ?? {}),
|
|
339
426
|
onFailedResponseHook: handle429,
|
|
427
|
+
debug: config.debug ?? this.debug,
|
|
340
428
|
});
|
|
341
429
|
this.hideInputs =
|
|
342
430
|
config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs;
|
|
@@ -346,13 +434,18 @@ class Client {
|
|
|
346
434
|
this.blockOnRootRunFinalization =
|
|
347
435
|
config.blockOnRootRunFinalization ?? this.blockOnRootRunFinalization;
|
|
348
436
|
this.batchSizeBytesLimit = config.batchSizeBytesLimit;
|
|
437
|
+
this.batchSizeLimit = config.batchSizeLimit;
|
|
349
438
|
this.fetchOptions = config.fetchOptions || {};
|
|
350
439
|
this.manualFlushMode = config.manualFlushMode ?? this.manualFlushMode;
|
|
440
|
+
if ((0, env_js_1.getOtelEnabled)()) {
|
|
441
|
+
this.langSmithToOTELTranslator = new translator_js_1.LangSmithToOTELTranslator();
|
|
442
|
+
}
|
|
443
|
+
// Cache metadata env vars once during construction to avoid repeatedly scanning process.env
|
|
444
|
+
this.cachedLSEnvVarsForMetadata = (0, env_js_1.getLangSmithEnvVarsMetadata)();
|
|
351
445
|
}
|
|
352
446
|
static getDefaultClientConfig() {
|
|
353
447
|
const apiKey = (0, env_js_1.getLangSmithEnvironmentVariable)("API_KEY");
|
|
354
|
-
const apiUrl = (0, env_js_1.getLangSmithEnvironmentVariable)("ENDPOINT") ??
|
|
355
|
-
"https://api.smith.langchain.com";
|
|
448
|
+
const apiUrl = (0, env_js_1.getLangSmithEnvironmentVariable)("ENDPOINT") ?? DEFAULT_API_URL;
|
|
356
449
|
const hideInputs = (0, env_js_1.getLangSmithEnvironmentVariable)("HIDE_INPUTS") === "true";
|
|
357
450
|
const hideOutputs = (0, env_js_1.getLangSmithEnvironmentVariable)("HIDE_OUTPUTS") === "true";
|
|
358
451
|
return {
|
|
@@ -404,9 +497,17 @@ class Client {
|
|
|
404
497
|
if (this.apiKey) {
|
|
405
498
|
headers["x-api-key"] = `${this.apiKey}`;
|
|
406
499
|
}
|
|
500
|
+
if (this.workspaceId) {
|
|
501
|
+
headers["x-tenant-id"] = this.workspaceId;
|
|
502
|
+
}
|
|
407
503
|
return headers;
|
|
408
504
|
}
|
|
409
|
-
|
|
505
|
+
_getPlatformEndpointPath(path) {
|
|
506
|
+
// Check if apiUrl already ends with /v1 or /v1/ to avoid double /v1/v1/ paths
|
|
507
|
+
const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
|
|
508
|
+
return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
|
|
509
|
+
}
|
|
510
|
+
async processInputs(inputs) {
|
|
410
511
|
if (this.hideInputs === false) {
|
|
411
512
|
return inputs;
|
|
412
513
|
}
|
|
@@ -418,7 +519,7 @@ class Client {
|
|
|
418
519
|
}
|
|
419
520
|
return inputs;
|
|
420
521
|
}
|
|
421
|
-
processOutputs(outputs) {
|
|
522
|
+
async processOutputs(outputs) {
|
|
422
523
|
if (this.hideOutputs === false) {
|
|
423
524
|
return outputs;
|
|
424
525
|
}
|
|
@@ -430,26 +531,29 @@ class Client {
|
|
|
430
531
|
}
|
|
431
532
|
return outputs;
|
|
432
533
|
}
|
|
433
|
-
prepareRunCreateOrUpdateInputs(run) {
|
|
534
|
+
async prepareRunCreateOrUpdateInputs(run) {
|
|
434
535
|
const runParams = { ...run };
|
|
435
536
|
if (runParams.inputs !== undefined) {
|
|
436
|
-
runParams.inputs = this.processInputs(runParams.inputs);
|
|
537
|
+
runParams.inputs = await this.processInputs(runParams.inputs);
|
|
437
538
|
}
|
|
438
539
|
if (runParams.outputs !== undefined) {
|
|
439
|
-
runParams.outputs = this.processOutputs(runParams.outputs);
|
|
540
|
+
runParams.outputs = await this.processOutputs(runParams.outputs);
|
|
440
541
|
}
|
|
441
542
|
return runParams;
|
|
442
543
|
}
|
|
443
544
|
async _getResponse(path, queryParams) {
|
|
444
545
|
const paramsString = queryParams?.toString() ?? "";
|
|
445
546
|
const url = `${this.apiUrl}${path}?${paramsString}`;
|
|
446
|
-
const response = await this.caller.call(
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
547
|
+
const response = await this.caller.call(async () => {
|
|
548
|
+
const res = await this._fetch(url, {
|
|
549
|
+
method: "GET",
|
|
550
|
+
headers: this.headers,
|
|
551
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
552
|
+
...this.fetchOptions,
|
|
553
|
+
});
|
|
554
|
+
await (0, error_js_1.raiseForStatus)(res, `fetch ${path}`);
|
|
555
|
+
return res;
|
|
451
556
|
});
|
|
452
|
-
await (0, error_js_1.raiseForStatus)(response, `Failed to fetch ${path}`);
|
|
453
557
|
return response;
|
|
454
558
|
}
|
|
455
559
|
async _get(path, queryParams) {
|
|
@@ -463,13 +567,16 @@ class Client {
|
|
|
463
567
|
queryParams.set("offset", String(offset));
|
|
464
568
|
queryParams.set("limit", String(limit));
|
|
465
569
|
const url = `${this.apiUrl}${path}?${queryParams}`;
|
|
466
|
-
const response = await this.caller.call(
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
570
|
+
const response = await this.caller.call(async () => {
|
|
571
|
+
const res = await this._fetch(url, {
|
|
572
|
+
method: "GET",
|
|
573
|
+
headers: this.headers,
|
|
574
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
575
|
+
...this.fetchOptions,
|
|
576
|
+
});
|
|
577
|
+
await (0, error_js_1.raiseForStatus)(res, `fetch ${path}`);
|
|
578
|
+
return res;
|
|
471
579
|
});
|
|
472
|
-
await (0, error_js_1.raiseForStatus)(response, `Failed to fetch ${path}`);
|
|
473
580
|
const items = transform
|
|
474
581
|
? transform(await response.json())
|
|
475
582
|
: await response.json();
|
|
@@ -486,12 +593,17 @@ class Client {
|
|
|
486
593
|
async *_getCursorPaginatedList(path, body = null, requestMethod = "POST", dataKey = "runs") {
|
|
487
594
|
const bodyParams = body ? { ...body } : {};
|
|
488
595
|
while (true) {
|
|
489
|
-
const
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
596
|
+
const body = JSON.stringify(bodyParams);
|
|
597
|
+
const response = await this.caller.call(async () => {
|
|
598
|
+
const res = await this._fetch(`${this.apiUrl}${path}`, {
|
|
599
|
+
method: requestMethod,
|
|
600
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
601
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
602
|
+
...this.fetchOptions,
|
|
603
|
+
body,
|
|
604
|
+
});
|
|
605
|
+
await (0, error_js_1.raiseForStatus)(res, `fetch ${path}`);
|
|
606
|
+
return res;
|
|
495
607
|
});
|
|
496
608
|
const responseBody = await response.json();
|
|
497
609
|
if (!responseBody) {
|
|
@@ -511,6 +623,13 @@ class Client {
|
|
|
511
623
|
bodyParams.cursor = cursors.next;
|
|
512
624
|
}
|
|
513
625
|
}
|
|
626
|
+
// Allows mocking for tests
|
|
627
|
+
_shouldSample() {
|
|
628
|
+
if (this.tracingSampleRate === undefined) {
|
|
629
|
+
return true;
|
|
630
|
+
}
|
|
631
|
+
return Math.random() < this.tracingSampleRate;
|
|
632
|
+
}
|
|
514
633
|
_filterForSampling(runs, patch = false) {
|
|
515
634
|
if (this.tracingSampleRate === undefined) {
|
|
516
635
|
return runs;
|
|
@@ -518,25 +637,36 @@ class Client {
|
|
|
518
637
|
if (patch) {
|
|
519
638
|
const sampled = [];
|
|
520
639
|
for (const run of runs) {
|
|
521
|
-
if (!this.filteredPostUuids.has(run.
|
|
640
|
+
if (!this.filteredPostUuids.has(run.trace_id)) {
|
|
522
641
|
sampled.push(run);
|
|
523
642
|
}
|
|
524
|
-
else {
|
|
525
|
-
this.filteredPostUuids.delete(run.
|
|
643
|
+
else if (run.id === run.trace_id) {
|
|
644
|
+
this.filteredPostUuids.delete(run.trace_id);
|
|
526
645
|
}
|
|
527
646
|
}
|
|
528
647
|
return sampled;
|
|
529
648
|
}
|
|
530
649
|
else {
|
|
650
|
+
// For new runs, sample at trace level to maintain consistency
|
|
531
651
|
const sampled = [];
|
|
532
652
|
for (const run of runs) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
653
|
+
const traceId = run.trace_id ?? run.id;
|
|
654
|
+
// If we've already made a decision about this trace, follow it
|
|
655
|
+
if (this.filteredPostUuids.has(traceId)) {
|
|
656
|
+
continue;
|
|
657
|
+
}
|
|
658
|
+
// For new traces, apply sampling
|
|
659
|
+
if (run.id === traceId) {
|
|
660
|
+
if (this._shouldSample()) {
|
|
661
|
+
sampled.push(run);
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
this.filteredPostUuids.add(traceId);
|
|
665
|
+
}
|
|
537
666
|
}
|
|
538
667
|
else {
|
|
539
|
-
|
|
668
|
+
// Child runs follow their trace's sampling decision
|
|
669
|
+
sampled.push(run);
|
|
540
670
|
}
|
|
541
671
|
}
|
|
542
672
|
return sampled;
|
|
@@ -546,83 +676,163 @@ class Client {
|
|
|
546
676
|
const serverInfo = await this._ensureServerInfo();
|
|
547
677
|
return (this.batchSizeBytesLimit ??
|
|
548
678
|
serverInfo.batch_ingest_config?.size_limit_bytes ??
|
|
549
|
-
exports.
|
|
679
|
+
exports.DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES);
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Get the maximum number of operations to batch in a single request.
|
|
683
|
+
*/
|
|
684
|
+
async _getBatchSizeLimit() {
|
|
685
|
+
const serverInfo = await this._ensureServerInfo();
|
|
686
|
+
return (this.batchSizeLimit ??
|
|
687
|
+
serverInfo.batch_ingest_config?.size_limit ??
|
|
688
|
+
DEFAULT_BATCH_SIZE_LIMIT);
|
|
550
689
|
}
|
|
551
|
-
async
|
|
690
|
+
async _getDatasetExamplesMultiPartSupport() {
|
|
552
691
|
const serverInfo = await this._ensureServerInfo();
|
|
553
692
|
return (serverInfo.instance_flags?.dataset_examples_multipart_enabled ?? false);
|
|
554
693
|
}
|
|
555
|
-
drainAutoBatchQueue(batchSizeLimit) {
|
|
694
|
+
drainAutoBatchQueue({ batchSizeLimitBytes, batchSizeLimit, }) {
|
|
556
695
|
const promises = [];
|
|
557
696
|
while (this.autoBatchQueue.items.length > 0) {
|
|
558
|
-
const [batch, done] = this.autoBatchQueue.pop(
|
|
697
|
+
const [batch, done] = this.autoBatchQueue.pop({
|
|
698
|
+
upToSizeBytes: batchSizeLimitBytes,
|
|
699
|
+
upToSize: batchSizeLimit,
|
|
700
|
+
});
|
|
559
701
|
if (!batch.length) {
|
|
560
702
|
done();
|
|
561
703
|
break;
|
|
562
704
|
}
|
|
563
|
-
const
|
|
564
|
-
|
|
705
|
+
const batchesByDestination = batch.reduce((acc, item) => {
|
|
706
|
+
const apiUrl = item.apiUrl ?? this.apiUrl;
|
|
707
|
+
const apiKey = item.apiKey ?? this.apiKey;
|
|
708
|
+
const isDefault = item.apiKey === this.apiKey && item.apiUrl === this.apiUrl;
|
|
709
|
+
const batchKey = isDefault ? "default" : `${apiUrl}|${apiKey}`;
|
|
710
|
+
if (!acc[batchKey]) {
|
|
711
|
+
acc[batchKey] = [];
|
|
712
|
+
}
|
|
713
|
+
acc[batchKey].push(item);
|
|
714
|
+
return acc;
|
|
715
|
+
}, {});
|
|
716
|
+
const batchPromises = [];
|
|
717
|
+
for (const [batchKey, batch] of Object.entries(batchesByDestination)) {
|
|
718
|
+
const batchPromise = this._processBatch(batch, {
|
|
719
|
+
apiUrl: batchKey === "default" ? undefined : batchKey.split("|")[0],
|
|
720
|
+
apiKey: batchKey === "default" ? undefined : batchKey.split("|")[1],
|
|
721
|
+
});
|
|
722
|
+
batchPromises.push(batchPromise);
|
|
723
|
+
}
|
|
724
|
+
// Wait for all batches to complete, then call the overall done callback
|
|
725
|
+
const allBatchesPromise = Promise.all(batchPromises).finally(done);
|
|
726
|
+
promises.push(allBatchesPromise);
|
|
565
727
|
}
|
|
566
728
|
return Promise.all(promises);
|
|
567
729
|
}
|
|
568
|
-
async _processBatch(batch,
|
|
730
|
+
async _processBatch(batch, options) {
|
|
569
731
|
if (!batch.length) {
|
|
570
|
-
done();
|
|
571
732
|
return;
|
|
572
733
|
}
|
|
573
734
|
try {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
.filter((item) => item.action === "create")
|
|
577
|
-
.map((item) => item.item),
|
|
578
|
-
runUpdates: batch
|
|
579
|
-
.filter((item) => item.action === "update")
|
|
580
|
-
.map((item) => item.item),
|
|
581
|
-
};
|
|
582
|
-
const serverInfo = await this._ensureServerInfo();
|
|
583
|
-
if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
|
|
584
|
-
await this.multipartIngestRuns(ingestParams);
|
|
735
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
736
|
+
this._sendBatchToOTELTranslator(batch);
|
|
585
737
|
}
|
|
586
738
|
else {
|
|
587
|
-
|
|
739
|
+
const ingestParams = {
|
|
740
|
+
runCreates: batch
|
|
741
|
+
.filter((item) => item.action === "create")
|
|
742
|
+
.map((item) => item.item),
|
|
743
|
+
runUpdates: batch
|
|
744
|
+
.filter((item) => item.action === "update")
|
|
745
|
+
.map((item) => item.item),
|
|
746
|
+
};
|
|
747
|
+
const serverInfo = await this._ensureServerInfo();
|
|
748
|
+
if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
|
|
749
|
+
const useGzip = serverInfo?.instance_flags?.gzip_body_enabled;
|
|
750
|
+
await this.multipartIngestRuns(ingestParams, { ...options, useGzip });
|
|
751
|
+
}
|
|
752
|
+
else {
|
|
753
|
+
await this.batchIngestRuns(ingestParams, options);
|
|
754
|
+
}
|
|
588
755
|
}
|
|
589
756
|
}
|
|
590
|
-
|
|
591
|
-
|
|
757
|
+
catch (e) {
|
|
758
|
+
console.error("Error exporting batch:", e);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
_sendBatchToOTELTranslator(batch) {
|
|
762
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
763
|
+
const otelContextMap = new Map();
|
|
764
|
+
const operations = [];
|
|
765
|
+
for (const item of batch) {
|
|
766
|
+
if (item.item.id && item.otelContext) {
|
|
767
|
+
otelContextMap.set(item.item.id, item.otelContext);
|
|
768
|
+
if (item.action === "create") {
|
|
769
|
+
operations.push({
|
|
770
|
+
operation: "post",
|
|
771
|
+
id: item.item.id,
|
|
772
|
+
trace_id: item.item.trace_id ?? item.item.id,
|
|
773
|
+
run: item.item,
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
else {
|
|
777
|
+
operations.push({
|
|
778
|
+
operation: "patch",
|
|
779
|
+
id: item.item.id,
|
|
780
|
+
trace_id: item.item.trace_id ?? item.item.id,
|
|
781
|
+
run: item.item,
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
this.langSmithToOTELTranslator.exportBatch(operations, otelContextMap);
|
|
592
787
|
}
|
|
593
788
|
}
|
|
594
789
|
async processRunOperation(item) {
|
|
595
790
|
clearTimeout(this.autoBatchTimeout);
|
|
596
791
|
this.autoBatchTimeout = undefined;
|
|
597
|
-
|
|
598
|
-
item.item = mergeRuntimeEnvIntoRunCreate(item.item);
|
|
599
|
-
}
|
|
792
|
+
item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata);
|
|
600
793
|
const itemPromise = this.autoBatchQueue.push(item);
|
|
601
794
|
if (this.manualFlushMode) {
|
|
602
795
|
// Rely on manual flushing in serverless environments
|
|
603
796
|
return itemPromise;
|
|
604
797
|
}
|
|
605
798
|
const sizeLimitBytes = await this._getBatchSizeLimitBytes();
|
|
606
|
-
|
|
607
|
-
|
|
799
|
+
const sizeLimit = await this._getBatchSizeLimit();
|
|
800
|
+
if (this.autoBatchQueue.sizeBytes > sizeLimitBytes ||
|
|
801
|
+
this.autoBatchQueue.items.length > sizeLimit) {
|
|
802
|
+
void this.drainAutoBatchQueue({
|
|
803
|
+
batchSizeLimitBytes: sizeLimitBytes,
|
|
804
|
+
batchSizeLimit: sizeLimit,
|
|
805
|
+
});
|
|
608
806
|
}
|
|
609
807
|
if (this.autoBatchQueue.items.length > 0) {
|
|
610
808
|
this.autoBatchTimeout = setTimeout(() => {
|
|
611
809
|
this.autoBatchTimeout = undefined;
|
|
612
|
-
void this.drainAutoBatchQueue(
|
|
810
|
+
void this.drainAutoBatchQueue({
|
|
811
|
+
batchSizeLimitBytes: sizeLimitBytes,
|
|
812
|
+
batchSizeLimit: sizeLimit,
|
|
813
|
+
});
|
|
613
814
|
}, this.autoBatchAggregationDelayMs);
|
|
614
815
|
}
|
|
615
816
|
return itemPromise;
|
|
616
817
|
}
|
|
617
818
|
async _getServerInfo() {
|
|
618
|
-
const response = await (
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
819
|
+
const response = await this.caller.call(async () => {
|
|
820
|
+
const res = await this._fetch(`${this.apiUrl}/info`, {
|
|
821
|
+
method: "GET",
|
|
822
|
+
headers: { Accept: "application/json" },
|
|
823
|
+
signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT_MS),
|
|
824
|
+
...this.fetchOptions,
|
|
825
|
+
});
|
|
826
|
+
await (0, error_js_1.raiseForStatus)(res, "get server info");
|
|
827
|
+
return res;
|
|
623
828
|
});
|
|
624
|
-
await
|
|
625
|
-
|
|
829
|
+
const json = await response.json();
|
|
830
|
+
if (this.debug) {
|
|
831
|
+
console.log("\n=== LangSmith Server Configuration ===\n" +
|
|
832
|
+
JSON.stringify(json, null, 2) +
|
|
833
|
+
"\n");
|
|
834
|
+
}
|
|
835
|
+
return json;
|
|
626
836
|
}
|
|
627
837
|
async _ensureServerInfo() {
|
|
628
838
|
if (this._getServerInfoPromise === undefined) {
|
|
@@ -632,7 +842,7 @@ class Client {
|
|
|
632
842
|
this._serverInfo = await this._getServerInfo();
|
|
633
843
|
}
|
|
634
844
|
catch (e) {
|
|
635
|
-
console.warn(`[
|
|
845
|
+
console.warn(`[LANGSMITH]: Failed to fetch info on supported operations. Falling back to batch operations and default limits. Info: ${e.status ?? "Unspecified status code"} ${e.message}`);
|
|
636
846
|
}
|
|
637
847
|
}
|
|
638
848
|
return this._serverInfo ?? {};
|
|
@@ -656,16 +866,34 @@ class Client {
|
|
|
656
866
|
*/
|
|
657
867
|
async flush() {
|
|
658
868
|
const sizeLimitBytes = await this._getBatchSizeLimitBytes();
|
|
659
|
-
await this.
|
|
869
|
+
const sizeLimit = await this._getBatchSizeLimit();
|
|
870
|
+
await this.drainAutoBatchQueue({
|
|
871
|
+
batchSizeLimitBytes: sizeLimitBytes,
|
|
872
|
+
batchSizeLimit: sizeLimit,
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
_cloneCurrentOTELContext() {
|
|
876
|
+
const otel_trace = (0, otel_js_1.getOTELTrace)();
|
|
877
|
+
const otel_context = (0, otel_js_1.getOTELContext)();
|
|
878
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
879
|
+
const currentSpan = otel_trace.getActiveSpan();
|
|
880
|
+
if (currentSpan) {
|
|
881
|
+
return otel_trace.setSpan(otel_context.active(), currentSpan);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
return undefined;
|
|
660
885
|
}
|
|
661
|
-
async createRun(run) {
|
|
886
|
+
async createRun(run, options) {
|
|
662
887
|
if (!this._filterForSampling([run]).length) {
|
|
663
888
|
return;
|
|
664
889
|
}
|
|
665
|
-
const headers = {
|
|
890
|
+
const headers = {
|
|
891
|
+
...this.headers,
|
|
892
|
+
"Content-Type": "application/json",
|
|
893
|
+
};
|
|
666
894
|
const session_name = run.project_name;
|
|
667
895
|
delete run.project_name;
|
|
668
|
-
const runCreate = this.prepareRunCreateOrUpdateInputs({
|
|
896
|
+
const runCreate = await this.prepareRunCreateOrUpdateInputs({
|
|
669
897
|
session_name,
|
|
670
898
|
...run,
|
|
671
899
|
start_time: run.start_time ?? Date.now(),
|
|
@@ -673,32 +901,46 @@ class Client {
|
|
|
673
901
|
if (this.autoBatchTracing &&
|
|
674
902
|
runCreate.trace_id !== undefined &&
|
|
675
903
|
runCreate.dotted_order !== undefined) {
|
|
904
|
+
const otelContext = this._cloneCurrentOTELContext();
|
|
676
905
|
void this.processRunOperation({
|
|
677
906
|
action: "create",
|
|
678
907
|
item: runCreate,
|
|
908
|
+
otelContext,
|
|
909
|
+
apiKey: options?.apiKey,
|
|
910
|
+
apiUrl: options?.apiUrl,
|
|
679
911
|
}).catch(console.error);
|
|
680
912
|
return;
|
|
681
913
|
}
|
|
682
|
-
const mergedRunCreateParam =
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
914
|
+
const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata);
|
|
915
|
+
if (options?.apiKey !== undefined) {
|
|
916
|
+
headers["x-api-key"] = options.apiKey;
|
|
917
|
+
}
|
|
918
|
+
if (options?.workspaceId !== undefined) {
|
|
919
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
920
|
+
}
|
|
921
|
+
const body = (0, index_js_2.serialize)(mergedRunCreateParam, `Creating run with id: ${mergedRunCreateParam.id}`);
|
|
922
|
+
await this.caller.call(async () => {
|
|
923
|
+
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs`, {
|
|
924
|
+
method: "POST",
|
|
925
|
+
headers,
|
|
926
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
927
|
+
...this.fetchOptions,
|
|
928
|
+
body,
|
|
929
|
+
});
|
|
930
|
+
await (0, error_js_1.raiseForStatus)(res, "create run", true);
|
|
931
|
+
return res;
|
|
689
932
|
});
|
|
690
|
-
await (0, error_js_1.raiseForStatus)(response, "create run", true);
|
|
691
933
|
}
|
|
692
934
|
/**
|
|
693
935
|
* Batch ingest/upsert multiple runs in the Langsmith system.
|
|
694
936
|
* @param runs
|
|
695
937
|
*/
|
|
696
|
-
async batchIngestRuns({ runCreates, runUpdates, }) {
|
|
938
|
+
async batchIngestRuns({ runCreates, runUpdates, }, options) {
|
|
697
939
|
if (runCreates === undefined && runUpdates === undefined) {
|
|
698
940
|
return;
|
|
699
941
|
}
|
|
700
|
-
let preparedCreateParams = runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? [];
|
|
701
|
-
let preparedUpdateParams = runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? [];
|
|
942
|
+
let preparedCreateParams = await Promise.all(runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? []);
|
|
943
|
+
let preparedUpdateParams = await Promise.all(runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? []);
|
|
702
944
|
if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) {
|
|
703
945
|
const createById = preparedCreateParams.reduce((params, run) => {
|
|
704
946
|
if (!run.id) {
|
|
@@ -723,8 +965,8 @@ class Client {
|
|
|
723
965
|
preparedUpdateParams = standaloneUpdates;
|
|
724
966
|
}
|
|
725
967
|
const rawBatch = {
|
|
726
|
-
post:
|
|
727
|
-
patch:
|
|
968
|
+
post: preparedCreateParams,
|
|
969
|
+
patch: preparedUpdateParams,
|
|
728
970
|
};
|
|
729
971
|
if (!rawBatch.post.length && !rawBatch.patch.length) {
|
|
730
972
|
return;
|
|
@@ -738,34 +980,45 @@ class Client {
|
|
|
738
980
|
const batchItems = rawBatch[key].reverse();
|
|
739
981
|
let batchItem = batchItems.pop();
|
|
740
982
|
while (batchItem !== undefined) {
|
|
983
|
+
// Type is wrong but this is a deprecated code path anyway
|
|
741
984
|
batchChunks[key].push(batchItem);
|
|
742
985
|
batchItem = batchItems.pop();
|
|
743
986
|
}
|
|
744
987
|
}
|
|
745
988
|
if (batchChunks.post.length > 0 || batchChunks.patch.length > 0) {
|
|
746
|
-
|
|
989
|
+
const runIds = batchChunks.post
|
|
990
|
+
.map((item) => item.id)
|
|
991
|
+
.concat(batchChunks.patch.map((item) => item.id))
|
|
992
|
+
.join(",");
|
|
993
|
+
await this._postBatchIngestRuns((0, index_js_2.serialize)(batchChunks, `Ingesting runs with ids: ${runIds}`), options);
|
|
747
994
|
}
|
|
748
995
|
}
|
|
749
|
-
async _postBatchIngestRuns(body) {
|
|
996
|
+
async _postBatchIngestRuns(body, options) {
|
|
750
997
|
const headers = {
|
|
751
998
|
...this.headers,
|
|
752
999
|
"Content-Type": "application/json",
|
|
753
1000
|
Accept: "application/json",
|
|
754
1001
|
};
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
1002
|
+
if (options?.apiKey !== undefined) {
|
|
1003
|
+
headers["x-api-key"] = options.apiKey;
|
|
1004
|
+
}
|
|
1005
|
+
await this.batchIngestCaller.call(async () => {
|
|
1006
|
+
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/batch`, {
|
|
1007
|
+
method: "POST",
|
|
1008
|
+
headers,
|
|
1009
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1010
|
+
...this.fetchOptions,
|
|
1011
|
+
body,
|
|
1012
|
+
});
|
|
1013
|
+
await (0, error_js_1.raiseForStatus)(res, "batch create run", true);
|
|
1014
|
+
return res;
|
|
761
1015
|
});
|
|
762
|
-
await (0, error_js_1.raiseForStatus)(response, "batch create run", true);
|
|
763
1016
|
}
|
|
764
1017
|
/**
|
|
765
1018
|
* Batch ingest/upsert multiple runs in the Langsmith system.
|
|
766
1019
|
* @param runs
|
|
767
1020
|
*/
|
|
768
|
-
async multipartIngestRuns({ runCreates, runUpdates, }) {
|
|
1021
|
+
async multipartIngestRuns({ runCreates, runUpdates, }, options) {
|
|
769
1022
|
if (runCreates === undefined && runUpdates === undefined) {
|
|
770
1023
|
return;
|
|
771
1024
|
}
|
|
@@ -773,7 +1026,7 @@ class Client {
|
|
|
773
1026
|
const allAttachments = {};
|
|
774
1027
|
let preparedCreateParams = [];
|
|
775
1028
|
for (const create of runCreates ?? []) {
|
|
776
|
-
const preparedCreate = this.prepareRunCreateOrUpdateInputs(create);
|
|
1029
|
+
const preparedCreate = await this.prepareRunCreateOrUpdateInputs(create);
|
|
777
1030
|
if (preparedCreate.id !== undefined &&
|
|
778
1031
|
preparedCreate.attachments !== undefined) {
|
|
779
1032
|
allAttachments[preparedCreate.id] = preparedCreate.attachments;
|
|
@@ -783,7 +1036,7 @@ class Client {
|
|
|
783
1036
|
}
|
|
784
1037
|
let preparedUpdateParams = [];
|
|
785
1038
|
for (const update of runUpdates ?? []) {
|
|
786
|
-
preparedUpdateParams.push(this.prepareRunCreateOrUpdateInputs(update));
|
|
1039
|
+
preparedUpdateParams.push(await this.prepareRunCreateOrUpdateInputs(update));
|
|
787
1040
|
}
|
|
788
1041
|
// require trace_id and dotted_order
|
|
789
1042
|
const invalidRunCreate = preparedCreateParams.find((runCreate) => {
|
|
@@ -835,10 +1088,10 @@ class Client {
|
|
|
835
1088
|
]) {
|
|
836
1089
|
for (const originalPayload of payloads) {
|
|
837
1090
|
// collect fields to be sent as separate parts
|
|
838
|
-
const { inputs, outputs, events, attachments, ...payload } = originalPayload;
|
|
839
|
-
const fields = { inputs, outputs, events };
|
|
1091
|
+
const { inputs, outputs, events, extra, error, serialized, attachments, ...payload } = originalPayload;
|
|
1092
|
+
const fields = { inputs, outputs, events, extra, error, serialized };
|
|
840
1093
|
// encode the main run payload
|
|
841
|
-
const stringifiedPayload = (0, index_js_2.serialize)(payload);
|
|
1094
|
+
const stringifiedPayload = (0, index_js_2.serialize)(payload, `Serializing for multipart ingestion of run with id: ${payload.id}`);
|
|
842
1095
|
accumulatedParts.push({
|
|
843
1096
|
name: `${method}.${payload.id}`,
|
|
844
1097
|
payload: new Blob([stringifiedPayload], {
|
|
@@ -850,7 +1103,7 @@ class Client {
|
|
|
850
1103
|
if (value === undefined) {
|
|
851
1104
|
continue;
|
|
852
1105
|
}
|
|
853
|
-
const stringifiedValue = (0, index_js_2.serialize)(value);
|
|
1106
|
+
const stringifiedValue = (0, index_js_2.serialize)(value, `Serializing ${key} for multipart ingestion of run with id: ${payload.id}`);
|
|
854
1107
|
accumulatedParts.push({
|
|
855
1108
|
name: `${method}.${payload.id}.${key}`,
|
|
856
1109
|
payload: new Blob([stringifiedValue], {
|
|
@@ -892,53 +1145,144 @@ class Client {
|
|
|
892
1145
|
accumulatedContext.push(`trace=${payload.trace_id},id=${payload.id}`);
|
|
893
1146
|
}
|
|
894
1147
|
}
|
|
895
|
-
await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "));
|
|
896
|
-
}
|
|
897
|
-
async
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
1148
|
+
await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "), options);
|
|
1149
|
+
}
|
|
1150
|
+
async _createNodeFetchBody(parts, boundary) {
|
|
1151
|
+
// Create multipart form data manually using Blobs
|
|
1152
|
+
const chunks = [];
|
|
1153
|
+
for (const part of parts) {
|
|
1154
|
+
// Add field boundary
|
|
1155
|
+
chunks.push(new Blob([`--${boundary}\r\n`]));
|
|
1156
|
+
chunks.push(new Blob([
|
|
1157
|
+
`Content-Disposition: form-data; name="${part.name}"\r\n`,
|
|
1158
|
+
`Content-Type: ${part.payload.type}\r\n\r\n`,
|
|
1159
|
+
]));
|
|
1160
|
+
chunks.push(part.payload);
|
|
1161
|
+
chunks.push(new Blob(["\r\n"]));
|
|
1162
|
+
}
|
|
1163
|
+
// Add final boundary
|
|
1164
|
+
chunks.push(new Blob([`--${boundary}--\r\n`]));
|
|
1165
|
+
// Combine all chunks into a single Blob
|
|
1166
|
+
const body = new Blob(chunks);
|
|
1167
|
+
// Convert Blob to ArrayBuffer for compatibility
|
|
1168
|
+
const arrayBuffer = await body.arrayBuffer();
|
|
1169
|
+
return arrayBuffer;
|
|
1170
|
+
}
|
|
1171
|
+
async _createMultipartStream(parts, boundary) {
|
|
1172
|
+
const encoder = new TextEncoder();
|
|
1173
|
+
// Create a ReadableStream for streaming the multipart data
|
|
1174
|
+
// Only do special handling if we're using node-fetch
|
|
1175
|
+
const stream = new ReadableStream({
|
|
1176
|
+
async start(controller) {
|
|
1177
|
+
// Helper function to write a chunk to the stream
|
|
1178
|
+
const writeChunk = async (chunk) => {
|
|
1179
|
+
if (typeof chunk === "string") {
|
|
1180
|
+
controller.enqueue(encoder.encode(chunk));
|
|
1181
|
+
}
|
|
1182
|
+
else {
|
|
1183
|
+
controller.enqueue(chunk);
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
// Write each part to the stream
|
|
1187
|
+
for (const part of parts) {
|
|
1188
|
+
// Write boundary and headers
|
|
1189
|
+
await writeChunk(`--${boundary}\r\n`);
|
|
1190
|
+
await writeChunk(`Content-Disposition: form-data; name="${part.name}"\r\n`);
|
|
1191
|
+
await writeChunk(`Content-Type: ${part.payload.type}\r\n\r\n`);
|
|
1192
|
+
// Write the payload
|
|
1193
|
+
const payloadStream = part.payload.stream();
|
|
1194
|
+
const reader = payloadStream.getReader();
|
|
1195
|
+
try {
|
|
1196
|
+
let result;
|
|
1197
|
+
while (!(result = await reader.read()).done) {
|
|
1198
|
+
controller.enqueue(result.value);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
finally {
|
|
1202
|
+
reader.releaseLock();
|
|
1203
|
+
}
|
|
1204
|
+
await writeChunk("\r\n");
|
|
1205
|
+
}
|
|
1206
|
+
// Write final boundary
|
|
1207
|
+
await writeChunk(`--${boundary}--\r\n`);
|
|
1208
|
+
controller.close();
|
|
1209
|
+
},
|
|
1210
|
+
});
|
|
1211
|
+
return stream;
|
|
1212
|
+
}
|
|
1213
|
+
async _sendMultipartRequest(parts, context, options) {
|
|
1214
|
+
// Create multipart form data boundary
|
|
1215
|
+
const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2);
|
|
1216
|
+
const isNodeFetch = (0, fetch_js_1._globalFetchImplementationIsNodeFetch)();
|
|
1217
|
+
const buildBuffered = () => this._createNodeFetchBody(parts, boundary);
|
|
1218
|
+
const buildStream = () => this._createMultipartStream(parts, boundary);
|
|
1219
|
+
const sendWithRetry = async (bodyFactory) => {
|
|
1220
|
+
return this.batchIngestCaller.call(async () => {
|
|
1221
|
+
const body = await bodyFactory();
|
|
1222
|
+
const headers = {
|
|
921
1223
|
...this.headers,
|
|
922
1224
|
"Content-Type": `multipart/form-data; boundary=${boundary}`,
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1225
|
+
};
|
|
1226
|
+
if (options?.apiKey !== undefined) {
|
|
1227
|
+
headers["x-api-key"] = options.apiKey;
|
|
1228
|
+
}
|
|
1229
|
+
let transformedBody = body;
|
|
1230
|
+
if (options?.useGzip &&
|
|
1231
|
+
typeof body === "object" &&
|
|
1232
|
+
"pipeThrough" in body) {
|
|
1233
|
+
transformedBody = body.pipeThrough(new CompressionStream("gzip"));
|
|
1234
|
+
headers["Content-Encoding"] = "gzip";
|
|
1235
|
+
}
|
|
1236
|
+
const response = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/multipart`, {
|
|
1237
|
+
method: "POST",
|
|
1238
|
+
headers,
|
|
1239
|
+
body: transformedBody,
|
|
1240
|
+
duplex: "half",
|
|
1241
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1242
|
+
...this.fetchOptions,
|
|
1243
|
+
});
|
|
1244
|
+
await (0, error_js_1.raiseForStatus)(response, `Failed to send multipart request`, true);
|
|
1245
|
+
return response;
|
|
927
1246
|
});
|
|
928
|
-
|
|
1247
|
+
};
|
|
1248
|
+
try {
|
|
1249
|
+
let res;
|
|
1250
|
+
let streamedAttempt = false;
|
|
1251
|
+
// attempt stream only if not disabled and not using node-fetch or Bun
|
|
1252
|
+
if (!isNodeFetch &&
|
|
1253
|
+
!this.multipartStreamingDisabled &&
|
|
1254
|
+
(0, env_js_1.getEnv)() !== "bun") {
|
|
1255
|
+
streamedAttempt = true;
|
|
1256
|
+
res = await sendWithRetry(buildStream);
|
|
1257
|
+
}
|
|
1258
|
+
else {
|
|
1259
|
+
res = await sendWithRetry(buildBuffered);
|
|
1260
|
+
}
|
|
1261
|
+
// if stream fails, fallback to buffered body
|
|
1262
|
+
if ((!this.multipartStreamingDisabled || streamedAttempt) &&
|
|
1263
|
+
res.status === 422 &&
|
|
1264
|
+
(options?.apiUrl ?? this.apiUrl) !== DEFAULT_API_URL) {
|
|
1265
|
+
console.warn(`Streaming multipart upload to ${options?.apiUrl ?? this.apiUrl}/runs/multipart failed. ` +
|
|
1266
|
+
`This usually means the host does not support chunked uploads. ` +
|
|
1267
|
+
`Retrying with a buffered upload for operation "${context}".`);
|
|
1268
|
+
// Disable streaming for future requests
|
|
1269
|
+
this.multipartStreamingDisabled = true;
|
|
1270
|
+
// retry with fully-buffered body
|
|
1271
|
+
res = await sendWithRetry(buildBuffered);
|
|
1272
|
+
}
|
|
929
1273
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
930
1274
|
}
|
|
931
1275
|
catch (e) {
|
|
932
1276
|
console.warn(`${e.message.trim()}\n\nContext: ${context}`);
|
|
933
1277
|
}
|
|
934
1278
|
}
|
|
935
|
-
async updateRun(runId, run) {
|
|
1279
|
+
async updateRun(runId, run, options) {
|
|
936
1280
|
(0, _uuid_js_1.assertUuid)(runId);
|
|
937
1281
|
if (run.inputs) {
|
|
938
|
-
run.inputs = this.processInputs(run.inputs);
|
|
1282
|
+
run.inputs = await this.processInputs(run.inputs);
|
|
939
1283
|
}
|
|
940
1284
|
if (run.outputs) {
|
|
941
|
-
run.outputs = this.processOutputs(run.outputs);
|
|
1285
|
+
run.outputs = await this.processOutputs(run.outputs);
|
|
942
1286
|
}
|
|
943
1287
|
// TODO: Untangle types
|
|
944
1288
|
const data = { ...run, id: runId };
|
|
@@ -948,34 +1292,60 @@ class Client {
|
|
|
948
1292
|
if (this.autoBatchTracing &&
|
|
949
1293
|
data.trace_id !== undefined &&
|
|
950
1294
|
data.dotted_order !== undefined) {
|
|
1295
|
+
const otelContext = this._cloneCurrentOTELContext();
|
|
951
1296
|
if (run.end_time !== undefined &&
|
|
952
1297
|
data.parent_run_id === undefined &&
|
|
953
1298
|
this.blockOnRootRunFinalization &&
|
|
954
1299
|
!this.manualFlushMode) {
|
|
955
1300
|
// Trigger batches as soon as a root trace ends and wait to ensure trace finishes
|
|
956
1301
|
// in serverless environments.
|
|
957
|
-
await this.processRunOperation({
|
|
1302
|
+
await this.processRunOperation({
|
|
1303
|
+
action: "update",
|
|
1304
|
+
item: data,
|
|
1305
|
+
otelContext,
|
|
1306
|
+
apiKey: options?.apiKey,
|
|
1307
|
+
apiUrl: options?.apiUrl,
|
|
1308
|
+
}).catch(console.error);
|
|
958
1309
|
return;
|
|
959
1310
|
}
|
|
960
1311
|
else {
|
|
961
|
-
void this.processRunOperation({
|
|
1312
|
+
void this.processRunOperation({
|
|
1313
|
+
action: "update",
|
|
1314
|
+
item: data,
|
|
1315
|
+
otelContext,
|
|
1316
|
+
apiKey: options?.apiKey,
|
|
1317
|
+
apiUrl: options?.apiUrl,
|
|
1318
|
+
}).catch(console.error);
|
|
962
1319
|
}
|
|
963
1320
|
return;
|
|
964
1321
|
}
|
|
965
|
-
const headers = {
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1322
|
+
const headers = {
|
|
1323
|
+
...this.headers,
|
|
1324
|
+
"Content-Type": "application/json",
|
|
1325
|
+
};
|
|
1326
|
+
if (options?.apiKey !== undefined) {
|
|
1327
|
+
headers["x-api-key"] = options.apiKey;
|
|
1328
|
+
}
|
|
1329
|
+
if (options?.workspaceId !== undefined) {
|
|
1330
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
1331
|
+
}
|
|
1332
|
+
const body = (0, index_js_2.serialize)(run, `Serializing payload to update run with id: ${runId}`);
|
|
1333
|
+
await this.caller.call(async () => {
|
|
1334
|
+
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/${runId}`, {
|
|
1335
|
+
method: "PATCH",
|
|
1336
|
+
headers,
|
|
1337
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1338
|
+
...this.fetchOptions,
|
|
1339
|
+
body,
|
|
1340
|
+
});
|
|
1341
|
+
await (0, error_js_1.raiseForStatus)(res, "update run", true);
|
|
1342
|
+
return res;
|
|
972
1343
|
});
|
|
973
|
-
await (0, error_js_1.raiseForStatus)(response, "update run", true);
|
|
974
1344
|
}
|
|
975
1345
|
async readRun(runId, { loadChildRuns } = { loadChildRuns: false }) {
|
|
976
1346
|
(0, _uuid_js_1.assertUuid)(runId);
|
|
977
1347
|
let run = await this._get(`/runs/${runId}`);
|
|
978
|
-
if (loadChildRuns
|
|
1348
|
+
if (loadChildRuns) {
|
|
979
1349
|
run = await this._loadChildRuns(run);
|
|
980
1350
|
}
|
|
981
1351
|
return run;
|
|
@@ -1014,7 +1384,11 @@ class Client {
|
|
|
1014
1384
|
}
|
|
1015
1385
|
}
|
|
1016
1386
|
async _loadChildRuns(run) {
|
|
1017
|
-
const childRuns = await toArray(this.listRuns({
|
|
1387
|
+
const childRuns = await toArray(this.listRuns({
|
|
1388
|
+
isRoot: false,
|
|
1389
|
+
projectId: run.session_id,
|
|
1390
|
+
traceId: run.trace_id,
|
|
1391
|
+
}));
|
|
1018
1392
|
const treemap = {};
|
|
1019
1393
|
const runs = {};
|
|
1020
1394
|
// TODO: make dotted order required when the migration finishes
|
|
@@ -1024,11 +1398,14 @@ class Client {
|
|
|
1024
1398
|
childRun.parent_run_id === undefined) {
|
|
1025
1399
|
throw new Error(`Child run ${childRun.id} has no parent`);
|
|
1026
1400
|
}
|
|
1027
|
-
if (
|
|
1028
|
-
|
|
1401
|
+
if (childRun.dotted_order?.startsWith(run.dotted_order ?? "") &&
|
|
1402
|
+
childRun.id !== run.id) {
|
|
1403
|
+
if (!(childRun.parent_run_id in treemap)) {
|
|
1404
|
+
treemap[childRun.parent_run_id] = [];
|
|
1405
|
+
}
|
|
1406
|
+
treemap[childRun.parent_run_id].push(childRun);
|
|
1407
|
+
runs[childRun.id] = childRun;
|
|
1029
1408
|
}
|
|
1030
|
-
treemap[childRun.parent_run_id].push(childRun);
|
|
1031
|
-
runs[childRun.id] = childRun;
|
|
1032
1409
|
}
|
|
1033
1410
|
run.child_runs = treemap[run.id] || [];
|
|
1034
1411
|
for (const runId in treemap) {
|
|
@@ -1121,7 +1498,7 @@ class Client {
|
|
|
1121
1498
|
* });
|
|
1122
1499
|
*/
|
|
1123
1500
|
async *listRuns(props) {
|
|
1124
|
-
const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, } = props;
|
|
1501
|
+
const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, order, } = props;
|
|
1125
1502
|
let projectIds = [];
|
|
1126
1503
|
if (projectId) {
|
|
1127
1504
|
projectIds = Array.isArray(projectId) ? projectId : [projectId];
|
|
@@ -1135,7 +1512,6 @@ class Client {
|
|
|
1135
1512
|
}
|
|
1136
1513
|
const default_select = [
|
|
1137
1514
|
"app_path",
|
|
1138
|
-
"child_run_ids",
|
|
1139
1515
|
"completion_cost",
|
|
1140
1516
|
"completion_tokens",
|
|
1141
1517
|
"dotted_order",
|
|
@@ -1180,7 +1556,11 @@ class Client {
|
|
|
1180
1556
|
trace: traceId,
|
|
1181
1557
|
select: select ? select : default_select,
|
|
1182
1558
|
is_root: isRoot,
|
|
1559
|
+
order,
|
|
1183
1560
|
};
|
|
1561
|
+
if (body.select.includes("child_run_ids")) {
|
|
1562
|
+
(0, warn_js_1.warnOnce)("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");
|
|
1563
|
+
}
|
|
1184
1564
|
let runsYielded = 0;
|
|
1185
1565
|
for await (const runs of this._getCursorPaginatedList("/runs/query", body)) {
|
|
1186
1566
|
if (limit) {
|
|
@@ -1200,6 +1580,53 @@ class Client {
|
|
|
1200
1580
|
}
|
|
1201
1581
|
}
|
|
1202
1582
|
}
|
|
1583
|
+
async *listGroupRuns(props) {
|
|
1584
|
+
const { projectId, projectName, groupBy, filter, startTime, endTime, limit, offset, } = props;
|
|
1585
|
+
const sessionId = projectId || (await this.readProject({ projectName })).id;
|
|
1586
|
+
const baseBody = {
|
|
1587
|
+
session_id: sessionId,
|
|
1588
|
+
group_by: groupBy,
|
|
1589
|
+
filter,
|
|
1590
|
+
start_time: startTime ? startTime.toISOString() : null,
|
|
1591
|
+
end_time: endTime ? endTime.toISOString() : null,
|
|
1592
|
+
limit: Number(limit) || 100,
|
|
1593
|
+
};
|
|
1594
|
+
let currentOffset = Number(offset) || 0;
|
|
1595
|
+
const path = "/runs/group";
|
|
1596
|
+
const url = `${this.apiUrl}${path}`;
|
|
1597
|
+
while (true) {
|
|
1598
|
+
const currentBody = {
|
|
1599
|
+
...baseBody,
|
|
1600
|
+
offset: currentOffset,
|
|
1601
|
+
};
|
|
1602
|
+
// Remove undefined values from the payload
|
|
1603
|
+
const filteredPayload = Object.fromEntries(Object.entries(currentBody).filter(([_, value]) => value !== undefined));
|
|
1604
|
+
const body = JSON.stringify(filteredPayload);
|
|
1605
|
+
const response = await this.caller.call(async () => {
|
|
1606
|
+
const res = await this._fetch(url, {
|
|
1607
|
+
method: "POST",
|
|
1608
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1609
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1610
|
+
...this.fetchOptions,
|
|
1611
|
+
body,
|
|
1612
|
+
});
|
|
1613
|
+
await (0, error_js_1.raiseForStatus)(res, `Failed to fetch ${path}`);
|
|
1614
|
+
return res;
|
|
1615
|
+
});
|
|
1616
|
+
const items = await response.json();
|
|
1617
|
+
const { groups, total } = items;
|
|
1618
|
+
if (groups.length === 0) {
|
|
1619
|
+
break;
|
|
1620
|
+
}
|
|
1621
|
+
for (const thread of groups) {
|
|
1622
|
+
yield thread;
|
|
1623
|
+
}
|
|
1624
|
+
currentOffset += groups.length;
|
|
1625
|
+
if (currentOffset >= total) {
|
|
1626
|
+
break;
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1203
1630
|
async getRunStats({ id, trace, parentRun, runType, projectNames, projectIds, referenceExampleIds, startTime, endTime, error, query, filter, traceFilter, treeFilter, isRoot, dataSourceType, }) {
|
|
1204
1631
|
let projectIds_ = projectIds || [];
|
|
1205
1632
|
if (projectNames) {
|
|
@@ -1227,12 +1654,17 @@ class Client {
|
|
|
1227
1654
|
};
|
|
1228
1655
|
// Remove undefined values from the payload
|
|
1229
1656
|
const filteredPayload = Object.fromEntries(Object.entries(payload).filter(([_, value]) => value !== undefined));
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1657
|
+
const body = JSON.stringify(filteredPayload);
|
|
1658
|
+
const response = await this.caller.call(async () => {
|
|
1659
|
+
const res = await this._fetch(`${this.apiUrl}/runs/stats`, {
|
|
1660
|
+
method: "POST",
|
|
1661
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1662
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1663
|
+
...this.fetchOptions,
|
|
1664
|
+
body,
|
|
1665
|
+
});
|
|
1666
|
+
await (0, error_js_1.raiseForStatus)(res, "get run stats");
|
|
1667
|
+
return res;
|
|
1236
1668
|
});
|
|
1237
1669
|
const result = await response.json();
|
|
1238
1670
|
return result;
|
|
@@ -1243,12 +1675,17 @@ class Client {
|
|
|
1243
1675
|
share_token: shareId || uuid.v4(),
|
|
1244
1676
|
};
|
|
1245
1677
|
(0, _uuid_js_1.assertUuid)(runId);
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1678
|
+
const body = JSON.stringify(data);
|
|
1679
|
+
const response = await this.caller.call(async () => {
|
|
1680
|
+
const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
|
|
1681
|
+
method: "PUT",
|
|
1682
|
+
headers: this.headers,
|
|
1683
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1684
|
+
...this.fetchOptions,
|
|
1685
|
+
body,
|
|
1686
|
+
});
|
|
1687
|
+
await (0, error_js_1.raiseForStatus)(res, "share run");
|
|
1688
|
+
return res;
|
|
1252
1689
|
});
|
|
1253
1690
|
const result = await response.json();
|
|
1254
1691
|
if (result === null || !("share_token" in result)) {
|
|
@@ -1258,21 +1695,28 @@ class Client {
|
|
|
1258
1695
|
}
|
|
1259
1696
|
async unshareRun(runId) {
|
|
1260
1697
|
(0, _uuid_js_1.assertUuid)(runId);
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1698
|
+
await this.caller.call(async () => {
|
|
1699
|
+
const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
|
|
1700
|
+
method: "DELETE",
|
|
1701
|
+
headers: this.headers,
|
|
1702
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1703
|
+
...this.fetchOptions,
|
|
1704
|
+
});
|
|
1705
|
+
await (0, error_js_1.raiseForStatus)(res, "unshare run", true);
|
|
1706
|
+
return res;
|
|
1266
1707
|
});
|
|
1267
|
-
await (0, error_js_1.raiseForStatus)(response, "unshare run", true);
|
|
1268
1708
|
}
|
|
1269
1709
|
async readRunSharedLink(runId) {
|
|
1270
1710
|
(0, _uuid_js_1.assertUuid)(runId);
|
|
1271
|
-
const response = await this.caller.call(
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1711
|
+
const response = await this.caller.call(async () => {
|
|
1712
|
+
const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
|
|
1713
|
+
method: "GET",
|
|
1714
|
+
headers: this.headers,
|
|
1715
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1716
|
+
...this.fetchOptions,
|
|
1717
|
+
});
|
|
1718
|
+
await (0, error_js_1.raiseForStatus)(res, "read run shared link");
|
|
1719
|
+
return res;
|
|
1276
1720
|
});
|
|
1277
1721
|
const result = await response.json();
|
|
1278
1722
|
if (result === null || !("share_token" in result)) {
|
|
@@ -1290,11 +1734,15 @@ class Client {
|
|
|
1290
1734
|
}
|
|
1291
1735
|
}
|
|
1292
1736
|
(0, _uuid_js_1.assertUuid)(shareToken);
|
|
1293
|
-
const response = await this.caller.call(
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1737
|
+
const response = await this.caller.call(async () => {
|
|
1738
|
+
const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/runs${queryParams}`, {
|
|
1739
|
+
method: "GET",
|
|
1740
|
+
headers: this.headers,
|
|
1741
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1742
|
+
...this.fetchOptions,
|
|
1743
|
+
});
|
|
1744
|
+
await (0, error_js_1.raiseForStatus)(res, "list shared runs");
|
|
1745
|
+
return res;
|
|
1298
1746
|
});
|
|
1299
1747
|
const runs = await response.json();
|
|
1300
1748
|
return runs;
|
|
@@ -1308,11 +1756,15 @@ class Client {
|
|
|
1308
1756
|
datasetId = dataset.id;
|
|
1309
1757
|
}
|
|
1310
1758
|
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1311
|
-
const response = await this.caller.call(
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1759
|
+
const response = await this.caller.call(async () => {
|
|
1760
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1761
|
+
method: "GET",
|
|
1762
|
+
headers: this.headers,
|
|
1763
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1764
|
+
...this.fetchOptions,
|
|
1765
|
+
});
|
|
1766
|
+
await (0, error_js_1.raiseForStatus)(res, "read dataset shared schema");
|
|
1767
|
+
return res;
|
|
1316
1768
|
});
|
|
1317
1769
|
const shareSchema = await response.json();
|
|
1318
1770
|
shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
|
|
@@ -1330,12 +1782,17 @@ class Client {
|
|
|
1330
1782
|
dataset_id: datasetId,
|
|
1331
1783
|
};
|
|
1332
1784
|
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1333
|
-
const
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1785
|
+
const body = JSON.stringify(data);
|
|
1786
|
+
const response = await this.caller.call(async () => {
|
|
1787
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1788
|
+
method: "PUT",
|
|
1789
|
+
headers: this.headers,
|
|
1790
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1791
|
+
...this.fetchOptions,
|
|
1792
|
+
body,
|
|
1793
|
+
});
|
|
1794
|
+
await (0, error_js_1.raiseForStatus)(res, "share dataset");
|
|
1795
|
+
return res;
|
|
1339
1796
|
});
|
|
1340
1797
|
const shareSchema = await response.json();
|
|
1341
1798
|
shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
|
|
@@ -1343,21 +1800,28 @@ class Client {
|
|
|
1343
1800
|
}
|
|
1344
1801
|
async unshareDataset(datasetId) {
|
|
1345
1802
|
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1803
|
+
await this.caller.call(async () => {
|
|
1804
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1805
|
+
method: "DELETE",
|
|
1806
|
+
headers: this.headers,
|
|
1807
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1808
|
+
...this.fetchOptions,
|
|
1809
|
+
});
|
|
1810
|
+
await (0, error_js_1.raiseForStatus)(res, "unshare dataset", true);
|
|
1811
|
+
return res;
|
|
1351
1812
|
});
|
|
1352
|
-
await (0, error_js_1.raiseForStatus)(response, "unshare dataset", true);
|
|
1353
1813
|
}
|
|
1354
1814
|
async readSharedDataset(shareToken) {
|
|
1355
1815
|
(0, _uuid_js_1.assertUuid)(shareToken);
|
|
1356
|
-
const response = await this.caller.call(
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1816
|
+
const response = await this.caller.call(async () => {
|
|
1817
|
+
const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/datasets`, {
|
|
1818
|
+
method: "GET",
|
|
1819
|
+
headers: this.headers,
|
|
1820
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1821
|
+
...this.fetchOptions,
|
|
1822
|
+
});
|
|
1823
|
+
await (0, error_js_1.raiseForStatus)(res, "read shared dataset");
|
|
1824
|
+
return res;
|
|
1361
1825
|
});
|
|
1362
1826
|
const dataset = await response.json();
|
|
1363
1827
|
return dataset;
|
|
@@ -1384,16 +1848,22 @@ class Client {
|
|
|
1384
1848
|
urlParams.append(key, value);
|
|
1385
1849
|
}
|
|
1386
1850
|
});
|
|
1387
|
-
const response = await this.caller.call(
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1851
|
+
const response = await this.caller.call(async () => {
|
|
1852
|
+
const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, {
|
|
1853
|
+
method: "GET",
|
|
1854
|
+
headers: this.headers,
|
|
1855
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1856
|
+
...this.fetchOptions,
|
|
1857
|
+
});
|
|
1858
|
+
await (0, error_js_1.raiseForStatus)(res, "list shared examples");
|
|
1859
|
+
return res;
|
|
1392
1860
|
});
|
|
1393
1861
|
const result = await response.json();
|
|
1394
1862
|
if (!response.ok) {
|
|
1395
1863
|
if ("detail" in result) {
|
|
1396
|
-
throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${result.detail
|
|
1864
|
+
throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${Array.isArray(result.detail)
|
|
1865
|
+
? result.detail.join("\n")
|
|
1866
|
+
: "Unspecified error"}`);
|
|
1397
1867
|
}
|
|
1398
1868
|
throw new Error(`Failed to list shared examples: ${response.status} ${response.statusText}`);
|
|
1399
1869
|
}
|
|
@@ -1417,14 +1887,18 @@ class Client {
|
|
|
1417
1887
|
if (referenceDatasetId !== null) {
|
|
1418
1888
|
body["reference_dataset_id"] = referenceDatasetId;
|
|
1419
1889
|
}
|
|
1420
|
-
const
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1890
|
+
const serializedBody = JSON.stringify(body);
|
|
1891
|
+
const response = await this.caller.call(async () => {
|
|
1892
|
+
const res = await this._fetch(endpoint, {
|
|
1893
|
+
method: "POST",
|
|
1894
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1895
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1896
|
+
...this.fetchOptions,
|
|
1897
|
+
body: serializedBody,
|
|
1898
|
+
});
|
|
1899
|
+
await (0, error_js_1.raiseForStatus)(res, "create project");
|
|
1900
|
+
return res;
|
|
1426
1901
|
});
|
|
1427
|
-
await (0, error_js_1.raiseForStatus)(response, "create project");
|
|
1428
1902
|
const result = await response.json();
|
|
1429
1903
|
return result;
|
|
1430
1904
|
}
|
|
@@ -1434,20 +1908,23 @@ class Client {
|
|
|
1434
1908
|
if (metadata) {
|
|
1435
1909
|
extra = { ...(extra || {}), metadata };
|
|
1436
1910
|
}
|
|
1437
|
-
const body = {
|
|
1911
|
+
const body = JSON.stringify({
|
|
1438
1912
|
name,
|
|
1439
1913
|
extra,
|
|
1440
1914
|
description,
|
|
1441
1915
|
end_time: endTime ? new Date(endTime).toISOString() : null,
|
|
1442
|
-
};
|
|
1443
|
-
const response = await this.caller.call(
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1916
|
+
});
|
|
1917
|
+
const response = await this.caller.call(async () => {
|
|
1918
|
+
const res = await this._fetch(endpoint, {
|
|
1919
|
+
method: "PATCH",
|
|
1920
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1921
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1922
|
+
...this.fetchOptions,
|
|
1923
|
+
body,
|
|
1924
|
+
});
|
|
1925
|
+
await (0, error_js_1.raiseForStatus)(res, "update project");
|
|
1926
|
+
return res;
|
|
1927
|
+
});
|
|
1451
1928
|
const result = await response.json();
|
|
1452
1929
|
return result;
|
|
1453
1930
|
}
|
|
@@ -1468,11 +1945,15 @@ class Client {
|
|
|
1468
1945
|
else {
|
|
1469
1946
|
throw new Error("Must provide projectName or projectId");
|
|
1470
1947
|
}
|
|
1471
|
-
const response = await this.caller.call(
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1948
|
+
const response = await this.caller.call(async () => {
|
|
1949
|
+
const res = await this._fetch(`${this.apiUrl}${path}?${params}`, {
|
|
1950
|
+
method: "GET",
|
|
1951
|
+
headers: this.headers,
|
|
1952
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1953
|
+
...this.fetchOptions,
|
|
1954
|
+
});
|
|
1955
|
+
await (0, error_js_1.raiseForStatus)(res, "has project");
|
|
1956
|
+
return res;
|
|
1476
1957
|
});
|
|
1477
1958
|
// consume the response body to release the connection
|
|
1478
1959
|
// https://undici.nodejs.org/#/?id=garbage-collection
|
|
@@ -1551,7 +2032,7 @@ class Client {
|
|
|
1551
2032
|
}
|
|
1552
2033
|
throw new Error("No projects found to resolve tenant.");
|
|
1553
2034
|
}
|
|
1554
|
-
async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, referenceFree, metadata, } = {}) {
|
|
2035
|
+
async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, includeStats, datasetVersion, referenceFree, metadata, } = {}) {
|
|
1555
2036
|
const params = new URLSearchParams();
|
|
1556
2037
|
if (projectIds !== undefined) {
|
|
1557
2038
|
for (const projectId of projectIds) {
|
|
@@ -1573,6 +2054,12 @@ class Client {
|
|
|
1573
2054
|
});
|
|
1574
2055
|
params.append("reference_dataset", dataset.id);
|
|
1575
2056
|
}
|
|
2057
|
+
if (includeStats !== undefined) {
|
|
2058
|
+
params.append("include_stats", includeStats.toString());
|
|
2059
|
+
}
|
|
2060
|
+
if (datasetVersion !== undefined) {
|
|
2061
|
+
params.append("dataset_version", datasetVersion);
|
|
2062
|
+
}
|
|
1576
2063
|
if (referenceFree !== undefined) {
|
|
1577
2064
|
params.append("reference_free", referenceFree.toString());
|
|
1578
2065
|
}
|
|
@@ -1598,13 +2085,16 @@ class Client {
|
|
|
1598
2085
|
projectId_ = projectId;
|
|
1599
2086
|
}
|
|
1600
2087
|
(0, _uuid_js_1.assertUuid)(projectId_);
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
2088
|
+
await this.caller.call(async () => {
|
|
2089
|
+
const res = await this._fetch(`${this.apiUrl}/sessions/${projectId_}`, {
|
|
2090
|
+
method: "DELETE",
|
|
2091
|
+
headers: this.headers,
|
|
2092
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2093
|
+
...this.fetchOptions,
|
|
2094
|
+
});
|
|
2095
|
+
await (0, error_js_1.raiseForStatus)(res, `delete session ${projectId_} (${projectName})`, true);
|
|
2096
|
+
return res;
|
|
1606
2097
|
});
|
|
1607
|
-
await (0, error_js_1.raiseForStatus)(response, `delete session ${projectId_} (${projectName})`, true);
|
|
1608
2098
|
}
|
|
1609
2099
|
async uploadCsv({ csvFile, fileName, inputKeys, outputKeys, description, dataType, name, }) {
|
|
1610
2100
|
const url = `${this.apiUrl}/datasets/upload`;
|
|
@@ -1625,14 +2115,17 @@ class Client {
|
|
|
1625
2115
|
if (name) {
|
|
1626
2116
|
formData.append("name", name);
|
|
1627
2117
|
}
|
|
1628
|
-
const response = await this.caller.call(
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
2118
|
+
const response = await this.caller.call(async () => {
|
|
2119
|
+
const res = await this._fetch(url, {
|
|
2120
|
+
method: "POST",
|
|
2121
|
+
headers: this.headers,
|
|
2122
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2123
|
+
...this.fetchOptions,
|
|
2124
|
+
body: formData,
|
|
2125
|
+
});
|
|
2126
|
+
await (0, error_js_1.raiseForStatus)(res, "upload CSV");
|
|
2127
|
+
return res;
|
|
1634
2128
|
});
|
|
1635
|
-
await (0, error_js_1.raiseForStatus)(response, "upload CSV");
|
|
1636
2129
|
const result = await response.json();
|
|
1637
2130
|
return result;
|
|
1638
2131
|
}
|
|
@@ -1651,14 +2144,18 @@ class Client {
|
|
|
1651
2144
|
if (outputsSchema) {
|
|
1652
2145
|
body.outputs_schema_definition = outputsSchema;
|
|
1653
2146
|
}
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
2147
|
+
const serializedBody = JSON.stringify(body);
|
|
2148
|
+
const response = await this.caller.call(async () => {
|
|
2149
|
+
const res = await this._fetch(`${this.apiUrl}/datasets`, {
|
|
2150
|
+
method: "POST",
|
|
2151
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2152
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2153
|
+
...this.fetchOptions,
|
|
2154
|
+
body: serializedBody,
|
|
2155
|
+
});
|
|
2156
|
+
await (0, error_js_1.raiseForStatus)(res, "create dataset");
|
|
2157
|
+
return res;
|
|
1660
2158
|
});
|
|
1661
|
-
await (0, error_js_1.raiseForStatus)(response, "create dataset");
|
|
1662
2159
|
const result = await response.json();
|
|
1663
2160
|
return result;
|
|
1664
2161
|
}
|
|
@@ -1666,14 +2163,14 @@ class Client {
|
|
|
1666
2163
|
let path = "/datasets";
|
|
1667
2164
|
// limit to 1 result
|
|
1668
2165
|
const params = new URLSearchParams({ limit: "1" });
|
|
1669
|
-
if (datasetId
|
|
2166
|
+
if (datasetId && datasetName) {
|
|
1670
2167
|
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1671
2168
|
}
|
|
1672
|
-
else if (datasetId
|
|
2169
|
+
else if (datasetId) {
|
|
1673
2170
|
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1674
2171
|
path += `/${datasetId}`;
|
|
1675
2172
|
}
|
|
1676
|
-
else if (datasetName
|
|
2173
|
+
else if (datasetName) {
|
|
1677
2174
|
params.append("name", datasetName);
|
|
1678
2175
|
}
|
|
1679
2176
|
else {
|
|
@@ -1783,14 +2280,18 @@ class Client {
|
|
|
1783
2280
|
}
|
|
1784
2281
|
const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
|
|
1785
2282
|
(0, _uuid_js_1.assertUuid)(_datasetId);
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
2283
|
+
const body = JSON.stringify(update);
|
|
2284
|
+
const response = await this.caller.call(async () => {
|
|
2285
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}`, {
|
|
2286
|
+
method: "PATCH",
|
|
2287
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2288
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2289
|
+
...this.fetchOptions,
|
|
2290
|
+
body,
|
|
2291
|
+
});
|
|
2292
|
+
await (0, error_js_1.raiseForStatus)(res, "update dataset");
|
|
2293
|
+
return res;
|
|
2294
|
+
});
|
|
1794
2295
|
return (await response.json());
|
|
1795
2296
|
}
|
|
1796
2297
|
/**
|
|
@@ -1815,17 +2316,21 @@ class Client {
|
|
|
1815
2316
|
}
|
|
1816
2317
|
const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
|
|
1817
2318
|
(0, _uuid_js_1.assertUuid)(_datasetId);
|
|
1818
|
-
const
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
2319
|
+
const body = JSON.stringify({
|
|
2320
|
+
as_of: typeof asOf === "string" ? asOf : asOf.toISOString(),
|
|
2321
|
+
tag,
|
|
2322
|
+
});
|
|
2323
|
+
await this.caller.call(async () => {
|
|
2324
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}/tags`, {
|
|
2325
|
+
method: "PUT",
|
|
2326
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2327
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2328
|
+
...this.fetchOptions,
|
|
2329
|
+
body,
|
|
2330
|
+
});
|
|
2331
|
+
await (0, error_js_1.raiseForStatus)(res, "update dataset tags", true);
|
|
2332
|
+
return res;
|
|
1827
2333
|
});
|
|
1828
|
-
await (0, error_js_1.raiseForStatus)(response, "update dataset tags");
|
|
1829
2334
|
}
|
|
1830
2335
|
async deleteDataset({ datasetId, datasetName, }) {
|
|
1831
2336
|
let path = "/datasets";
|
|
@@ -1844,14 +2349,16 @@ class Client {
|
|
|
1844
2349
|
else {
|
|
1845
2350
|
throw new Error("Must provide datasetName or datasetId");
|
|
1846
2351
|
}
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
2352
|
+
await this.caller.call(async () => {
|
|
2353
|
+
const res = await this._fetch(this.apiUrl + path, {
|
|
2354
|
+
method: "DELETE",
|
|
2355
|
+
headers: this.headers,
|
|
2356
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2357
|
+
...this.fetchOptions,
|
|
2358
|
+
});
|
|
2359
|
+
await (0, error_js_1.raiseForStatus)(res, `delete ${path}`, true);
|
|
2360
|
+
return res;
|
|
1852
2361
|
});
|
|
1853
|
-
await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
|
|
1854
|
-
await response.json();
|
|
1855
2362
|
}
|
|
1856
2363
|
async indexDataset({ datasetId, datasetName, tag, }) {
|
|
1857
2364
|
let datasetId_ = datasetId;
|
|
@@ -1869,14 +2376,18 @@ class Client {
|
|
|
1869
2376
|
const data = {
|
|
1870
2377
|
tag: tag,
|
|
1871
2378
|
};
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
2379
|
+
const body = JSON.stringify(data);
|
|
2380
|
+
const response = await this.caller.call(async () => {
|
|
2381
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/index`, {
|
|
2382
|
+
method: "POST",
|
|
2383
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2384
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2385
|
+
...this.fetchOptions,
|
|
2386
|
+
body,
|
|
2387
|
+
});
|
|
2388
|
+
await (0, error_js_1.raiseForStatus)(res, "index dataset");
|
|
2389
|
+
return res;
|
|
2390
|
+
});
|
|
1880
2391
|
await response.json();
|
|
1881
2392
|
}
|
|
1882
2393
|
/**
|
|
@@ -1918,14 +2429,18 @@ class Client {
|
|
|
1918
2429
|
data["filter"] = filter;
|
|
1919
2430
|
}
|
|
1920
2431
|
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1921
|
-
const
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2432
|
+
const body = JSON.stringify(data);
|
|
2433
|
+
const response = await this.caller.call(async () => {
|
|
2434
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/search`, {
|
|
2435
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2436
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2437
|
+
...this.fetchOptions,
|
|
2438
|
+
method: "POST",
|
|
2439
|
+
body,
|
|
2440
|
+
});
|
|
2441
|
+
await (0, error_js_1.raiseForStatus)(res, "fetch similar examples");
|
|
2442
|
+
return res;
|
|
2443
|
+
});
|
|
1929
2444
|
const result = await response.json();
|
|
1930
2445
|
return result["examples"];
|
|
1931
2446
|
}
|
|
@@ -2137,14 +2652,16 @@ class Client {
|
|
|
2137
2652
|
async deleteExample(exampleId) {
|
|
2138
2653
|
(0, _uuid_js_1.assertUuid)(exampleId);
|
|
2139
2654
|
const path = `/examples/${exampleId}`;
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2655
|
+
await this.caller.call(async () => {
|
|
2656
|
+
const res = await this._fetch(this.apiUrl + path, {
|
|
2657
|
+
method: "DELETE",
|
|
2658
|
+
headers: this.headers,
|
|
2659
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2660
|
+
...this.fetchOptions,
|
|
2661
|
+
});
|
|
2662
|
+
await (0, error_js_1.raiseForStatus)(res, `delete ${path}`, true);
|
|
2663
|
+
return res;
|
|
2145
2664
|
});
|
|
2146
|
-
await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
|
|
2147
|
-
await response.json();
|
|
2148
2665
|
}
|
|
2149
2666
|
async updateExample(exampleIdOrUpdate, update) {
|
|
2150
2667
|
let exampleId;
|
|
@@ -2216,13 +2733,16 @@ class Client {
|
|
|
2216
2733
|
if (tag !== undefined) {
|
|
2217
2734
|
params.append("tag", tag);
|
|
2218
2735
|
}
|
|
2219
|
-
const response = await this.caller.call(
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2736
|
+
const response = await this.caller.call(async () => {
|
|
2737
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${resolvedDatasetId}/version?${params.toString()}`, {
|
|
2738
|
+
method: "GET",
|
|
2739
|
+
headers: { ...this.headers },
|
|
2740
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2741
|
+
...this.fetchOptions,
|
|
2742
|
+
});
|
|
2743
|
+
await (0, error_js_1.raiseForStatus)(res, "read dataset version");
|
|
2744
|
+
return res;
|
|
2224
2745
|
});
|
|
2225
|
-
await (0, error_js_1.raiseForStatus)(response, "read dataset version");
|
|
2226
2746
|
return await response.json();
|
|
2227
2747
|
}
|
|
2228
2748
|
async listDatasetSplits({ datasetId, datasetName, asOf, }) {
|
|
@@ -2277,14 +2797,18 @@ class Client {
|
|
|
2277
2797
|
}),
|
|
2278
2798
|
remove,
|
|
2279
2799
|
};
|
|
2280
|
-
const
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2800
|
+
const body = JSON.stringify(data);
|
|
2801
|
+
await this.caller.call(async () => {
|
|
2802
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/splits`, {
|
|
2803
|
+
method: "PUT",
|
|
2804
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2805
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2806
|
+
...this.fetchOptions,
|
|
2807
|
+
body,
|
|
2808
|
+
});
|
|
2809
|
+
await (0, error_js_1.raiseForStatus)(res, "update dataset splits", true);
|
|
2810
|
+
return res;
|
|
2286
2811
|
});
|
|
2287
|
-
await (0, error_js_1.raiseForStatus)(response, "update dataset splits", true);
|
|
2288
2812
|
}
|
|
2289
2813
|
/**
|
|
2290
2814
|
* @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
|
|
@@ -2333,7 +2857,7 @@ class Client {
|
|
|
2333
2857
|
id: feedbackId ?? uuid.v4(),
|
|
2334
2858
|
run_id: runId,
|
|
2335
2859
|
key,
|
|
2336
|
-
score,
|
|
2860
|
+
score: _formatFeedbackScore(score),
|
|
2337
2861
|
value,
|
|
2338
2862
|
correction,
|
|
2339
2863
|
comment,
|
|
@@ -2342,21 +2866,25 @@ class Client {
|
|
|
2342
2866
|
feedbackConfig,
|
|
2343
2867
|
session_id: projectId,
|
|
2344
2868
|
};
|
|
2869
|
+
const body = JSON.stringify(feedback);
|
|
2345
2870
|
const url = `${this.apiUrl}/feedback`;
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2871
|
+
await this.caller.call(async () => {
|
|
2872
|
+
const res = await this._fetch(url, {
|
|
2873
|
+
method: "POST",
|
|
2874
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2875
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2876
|
+
...this.fetchOptions,
|
|
2877
|
+
body,
|
|
2878
|
+
});
|
|
2879
|
+
await (0, error_js_1.raiseForStatus)(res, "create feedback", true);
|
|
2880
|
+
return res;
|
|
2881
|
+
});
|
|
2354
2882
|
return feedback;
|
|
2355
2883
|
}
|
|
2356
2884
|
async updateFeedback(feedbackId, { score, value, correction, comment, }) {
|
|
2357
2885
|
const feedbackUpdate = {};
|
|
2358
2886
|
if (score !== undefined && score !== null) {
|
|
2359
|
-
feedbackUpdate["score"] = score;
|
|
2887
|
+
feedbackUpdate["score"] = _formatFeedbackScore(score);
|
|
2360
2888
|
}
|
|
2361
2889
|
if (value !== undefined && value !== null) {
|
|
2362
2890
|
feedbackUpdate["value"] = value;
|
|
@@ -2368,14 +2896,18 @@ class Client {
|
|
|
2368
2896
|
feedbackUpdate["comment"] = comment;
|
|
2369
2897
|
}
|
|
2370
2898
|
(0, _uuid_js_1.assertUuid)(feedbackId);
|
|
2371
|
-
const
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2899
|
+
const body = JSON.stringify(feedbackUpdate);
|
|
2900
|
+
await this.caller.call(async () => {
|
|
2901
|
+
const res = await this._fetch(`${this.apiUrl}/feedback/${feedbackId}`, {
|
|
2902
|
+
method: "PATCH",
|
|
2903
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2904
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2905
|
+
...this.fetchOptions,
|
|
2906
|
+
body,
|
|
2907
|
+
});
|
|
2908
|
+
await (0, error_js_1.raiseForStatus)(res, "update feedback", true);
|
|
2909
|
+
return res;
|
|
2377
2910
|
});
|
|
2378
|
-
await (0, error_js_1.raiseForStatus)(response, "update feedback", true);
|
|
2379
2911
|
}
|
|
2380
2912
|
async readFeedback(feedbackId) {
|
|
2381
2913
|
(0, _uuid_js_1.assertUuid)(feedbackId);
|
|
@@ -2386,19 +2918,24 @@ class Client {
|
|
|
2386
2918
|
async deleteFeedback(feedbackId) {
|
|
2387
2919
|
(0, _uuid_js_1.assertUuid)(feedbackId);
|
|
2388
2920
|
const path = `/feedback/${feedbackId}`;
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2921
|
+
await this.caller.call(async () => {
|
|
2922
|
+
const res = await this._fetch(this.apiUrl + path, {
|
|
2923
|
+
method: "DELETE",
|
|
2924
|
+
headers: this.headers,
|
|
2925
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2926
|
+
...this.fetchOptions,
|
|
2927
|
+
});
|
|
2928
|
+
await (0, error_js_1.raiseForStatus)(res, `delete ${path}`, true);
|
|
2929
|
+
return res;
|
|
2394
2930
|
});
|
|
2395
|
-
await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
|
|
2396
|
-
await response.json();
|
|
2397
2931
|
}
|
|
2398
2932
|
async *listFeedback({ runIds, feedbackKeys, feedbackSourceTypes, } = {}) {
|
|
2399
2933
|
const queryParams = new URLSearchParams();
|
|
2400
2934
|
if (runIds) {
|
|
2401
|
-
|
|
2935
|
+
for (const runId of runIds) {
|
|
2936
|
+
(0, _uuid_js_1.assertUuid)(runId);
|
|
2937
|
+
queryParams.append("run", runId);
|
|
2938
|
+
}
|
|
2402
2939
|
}
|
|
2403
2940
|
if (feedbackKeys) {
|
|
2404
2941
|
for (const key of feedbackKeys) {
|
|
@@ -2448,15 +2985,19 @@ class Client {
|
|
|
2448
2985
|
hours: 3,
|
|
2449
2986
|
};
|
|
2450
2987
|
}
|
|
2451
|
-
const
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2988
|
+
const serializedBody = JSON.stringify(body);
|
|
2989
|
+
const response = await this.caller.call(async () => {
|
|
2990
|
+
const res = await this._fetch(`${this.apiUrl}/feedback/tokens`, {
|
|
2991
|
+
method: "POST",
|
|
2992
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2993
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2994
|
+
...this.fetchOptions,
|
|
2995
|
+
body: serializedBody,
|
|
2996
|
+
});
|
|
2997
|
+
await (0, error_js_1.raiseForStatus)(res, "create presigned feedback token");
|
|
2998
|
+
return res;
|
|
2457
2999
|
});
|
|
2458
|
-
|
|
2459
|
-
return result;
|
|
3000
|
+
return await response.json();
|
|
2460
3001
|
}
|
|
2461
3002
|
async createComparativeExperiment({ name, experimentIds, referenceDatasetId, createdAt, description, metadata, id, }) {
|
|
2462
3003
|
if (experimentIds.length === 0) {
|
|
@@ -2481,14 +3022,19 @@ class Client {
|
|
|
2481
3022
|
};
|
|
2482
3023
|
if (metadata)
|
|
2483
3024
|
body.extra["metadata"] = metadata;
|
|
2484
|
-
const
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
3025
|
+
const serializedBody = JSON.stringify(body);
|
|
3026
|
+
const response = await this.caller.call(async () => {
|
|
3027
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/comparative`, {
|
|
3028
|
+
method: "POST",
|
|
3029
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3030
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3031
|
+
...this.fetchOptions,
|
|
3032
|
+
body: serializedBody,
|
|
3033
|
+
});
|
|
3034
|
+
await (0, error_js_1.raiseForStatus)(res, "create comparative experiment");
|
|
3035
|
+
return res;
|
|
2490
3036
|
});
|
|
2491
|
-
return
|
|
3037
|
+
return response.json();
|
|
2492
3038
|
}
|
|
2493
3039
|
/**
|
|
2494
3040
|
* Retrieves a list of presigned feedback tokens for a given run ID.
|
|
@@ -2590,37 +3136,44 @@ class Client {
|
|
|
2590
3136
|
* @returns The created AnnotationQueue object
|
|
2591
3137
|
*/
|
|
2592
3138
|
async createAnnotationQueue(options) {
|
|
2593
|
-
const { name, description, queueId } = options;
|
|
3139
|
+
const { name, description, queueId, rubricInstructions } = options;
|
|
2594
3140
|
const body = {
|
|
2595
3141
|
name,
|
|
2596
3142
|
description,
|
|
2597
3143
|
id: queueId || uuid.v4(),
|
|
3144
|
+
rubric_instructions: rubricInstructions,
|
|
2598
3145
|
};
|
|
2599
|
-
const
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
3146
|
+
const serializedBody = JSON.stringify(Object.fromEntries(Object.entries(body).filter(([_, v]) => v !== undefined)));
|
|
3147
|
+
const response = await this.caller.call(async () => {
|
|
3148
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues`, {
|
|
3149
|
+
method: "POST",
|
|
3150
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3151
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3152
|
+
...this.fetchOptions,
|
|
3153
|
+
body: serializedBody,
|
|
3154
|
+
});
|
|
3155
|
+
await (0, error_js_1.raiseForStatus)(res, "create annotation queue");
|
|
3156
|
+
return res;
|
|
2605
3157
|
});
|
|
2606
|
-
|
|
2607
|
-
const data = await response.json();
|
|
2608
|
-
return data;
|
|
3158
|
+
return response.json();
|
|
2609
3159
|
}
|
|
2610
3160
|
/**
|
|
2611
3161
|
* Read an annotation queue with the specified queue ID.
|
|
2612
3162
|
* @param queueId - The ID of the annotation queue to read
|
|
2613
|
-
* @returns The
|
|
3163
|
+
* @returns The AnnotationQueueWithDetails object
|
|
2614
3164
|
*/
|
|
2615
3165
|
async readAnnotationQueue(queueId) {
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
3166
|
+
const response = await this.caller.call(async () => {
|
|
3167
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
|
|
3168
|
+
method: "GET",
|
|
3169
|
+
headers: this.headers,
|
|
3170
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3171
|
+
...this.fetchOptions,
|
|
3172
|
+
});
|
|
3173
|
+
await (0, error_js_1.raiseForStatus)(res, "read annotation queue");
|
|
3174
|
+
return res;
|
|
3175
|
+
});
|
|
3176
|
+
return response.json();
|
|
2624
3177
|
}
|
|
2625
3178
|
/**
|
|
2626
3179
|
* Update an annotation queue with the specified queue ID.
|
|
@@ -2630,28 +3183,39 @@ class Client {
|
|
|
2630
3183
|
* @param options.description - The new description for the annotation queue
|
|
2631
3184
|
*/
|
|
2632
3185
|
async updateAnnotationQueue(queueId, options) {
|
|
2633
|
-
const { name, description } = options;
|
|
2634
|
-
const
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
3186
|
+
const { name, description, rubricInstructions } = options;
|
|
3187
|
+
const body = JSON.stringify({
|
|
3188
|
+
name,
|
|
3189
|
+
description,
|
|
3190
|
+
rubric_instructions: rubricInstructions,
|
|
3191
|
+
});
|
|
3192
|
+
await this.caller.call(async () => {
|
|
3193
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
|
|
3194
|
+
method: "PATCH",
|
|
3195
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3196
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3197
|
+
...this.fetchOptions,
|
|
3198
|
+
body,
|
|
3199
|
+
});
|
|
3200
|
+
await (0, error_js_1.raiseForStatus)(res, "update annotation queue", true);
|
|
3201
|
+
return res;
|
|
2640
3202
|
});
|
|
2641
|
-
await (0, error_js_1.raiseForStatus)(response, "update annotation queue");
|
|
2642
3203
|
}
|
|
2643
3204
|
/**
|
|
2644
3205
|
* Delete an annotation queue with the specified queue ID.
|
|
2645
3206
|
* @param queueId - The ID of the annotation queue to delete
|
|
2646
3207
|
*/
|
|
2647
3208
|
async deleteAnnotationQueue(queueId) {
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
3209
|
+
await this.caller.call(async () => {
|
|
3210
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
|
|
3211
|
+
method: "DELETE",
|
|
3212
|
+
headers: { ...this.headers, Accept: "application/json" },
|
|
3213
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3214
|
+
...this.fetchOptions,
|
|
3215
|
+
});
|
|
3216
|
+
await (0, error_js_1.raiseForStatus)(res, "delete annotation queue", true);
|
|
3217
|
+
return res;
|
|
2653
3218
|
});
|
|
2654
|
-
await (0, error_js_1.raiseForStatus)(response, "delete annotation queue");
|
|
2655
3219
|
}
|
|
2656
3220
|
/**
|
|
2657
3221
|
* Add runs to an annotation queue with the specified queue ID.
|
|
@@ -2659,14 +3223,18 @@ class Client {
|
|
|
2659
3223
|
* @param runIds - The IDs of the runs to be added to the annotation queue
|
|
2660
3224
|
*/
|
|
2661
3225
|
async addRunsToAnnotationQueue(queueId, runIds) {
|
|
2662
|
-
const
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
3226
|
+
const body = JSON.stringify(runIds.map((id, i) => (0, _uuid_js_1.assertUuid)(id, `runIds[${i}]`).toString()));
|
|
3227
|
+
await this.caller.call(async () => {
|
|
3228
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs`, {
|
|
3229
|
+
method: "POST",
|
|
3230
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3231
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3232
|
+
...this.fetchOptions,
|
|
3233
|
+
body,
|
|
3234
|
+
});
|
|
3235
|
+
await (0, error_js_1.raiseForStatus)(res, "add runs to annotation queue", true);
|
|
3236
|
+
return res;
|
|
2668
3237
|
});
|
|
2669
|
-
await (0, error_js_1.raiseForStatus)(response, "add runs to annotation queue");
|
|
2670
3238
|
}
|
|
2671
3239
|
/**
|
|
2672
3240
|
* Get a run from an annotation queue at the specified index.
|
|
@@ -2677,14 +3245,17 @@ class Client {
|
|
|
2677
3245
|
*/
|
|
2678
3246
|
async getRunFromAnnotationQueue(queueId, index) {
|
|
2679
3247
|
const baseUrl = `/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/run`;
|
|
2680
|
-
const response = await this.caller.call(
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
3248
|
+
const response = await this.caller.call(async () => {
|
|
3249
|
+
const res = await this._fetch(`${this.apiUrl}${baseUrl}/${index}`, {
|
|
3250
|
+
method: "GET",
|
|
3251
|
+
headers: this.headers,
|
|
3252
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3253
|
+
...this.fetchOptions,
|
|
3254
|
+
});
|
|
3255
|
+
await (0, error_js_1.raiseForStatus)(res, "get run from annotation queue");
|
|
3256
|
+
return res;
|
|
2685
3257
|
});
|
|
2686
|
-
|
|
2687
|
-
return await response.json();
|
|
3258
|
+
return response.json();
|
|
2688
3259
|
}
|
|
2689
3260
|
/**
|
|
2690
3261
|
* Delete a run from an an annotation queue.
|
|
@@ -2692,27 +3263,33 @@ class Client {
|
|
|
2692
3263
|
* @param queueRunId - The ID of the run to delete from the annotation queue
|
|
2693
3264
|
*/
|
|
2694
3265
|
async deleteRunFromAnnotationQueue(queueId, queueRunId) {
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
3266
|
+
await this.caller.call(async () => {
|
|
3267
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs/${(0, _uuid_js_1.assertUuid)(queueRunId, "queueRunId")}`, {
|
|
3268
|
+
method: "DELETE",
|
|
3269
|
+
headers: { ...this.headers, Accept: "application/json" },
|
|
3270
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3271
|
+
...this.fetchOptions,
|
|
3272
|
+
});
|
|
3273
|
+
await (0, error_js_1.raiseForStatus)(res, "delete run from annotation queue", true);
|
|
3274
|
+
return res;
|
|
2700
3275
|
});
|
|
2701
|
-
await (0, error_js_1.raiseForStatus)(response, "delete run from annotation queue");
|
|
2702
3276
|
}
|
|
2703
3277
|
/**
|
|
2704
3278
|
* Get the size of an annotation queue.
|
|
2705
3279
|
* @param queueId - The ID of the annotation queue
|
|
2706
3280
|
*/
|
|
2707
3281
|
async getSizeFromAnnotationQueue(queueId) {
|
|
2708
|
-
const response = await this.caller.call(
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
3282
|
+
const response = await this.caller.call(async () => {
|
|
3283
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/size`, {
|
|
3284
|
+
method: "GET",
|
|
3285
|
+
headers: this.headers,
|
|
3286
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3287
|
+
...this.fetchOptions,
|
|
3288
|
+
});
|
|
3289
|
+
await (0, error_js_1.raiseForStatus)(res, "get size from annotation queue");
|
|
3290
|
+
return res;
|
|
2713
3291
|
});
|
|
2714
|
-
|
|
2715
|
-
return await response.json();
|
|
3292
|
+
return response.json();
|
|
2716
3293
|
}
|
|
2717
3294
|
async _currentTenantIsOwner(owner) {
|
|
2718
3295
|
const settings = await this._getSettings();
|
|
@@ -2725,22 +3302,17 @@ class Client {
|
|
|
2725
3302
|
Requested tenant: ${owner}`);
|
|
2726
3303
|
}
|
|
2727
3304
|
async _getLatestCommitHash(promptOwnerAndName) {
|
|
2728
|
-
const
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
const error = new Error(`Error ${res.status}: ${res.statusText}\n${detail}`);
|
|
2740
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2741
|
-
error.statusCode = res.status;
|
|
2742
|
-
throw error;
|
|
2743
|
-
}
|
|
3305
|
+
const response = await this.caller.call(async () => {
|
|
3306
|
+
const res = await this._fetch(`${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, {
|
|
3307
|
+
method: "GET",
|
|
3308
|
+
headers: this.headers,
|
|
3309
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3310
|
+
...this.fetchOptions,
|
|
3311
|
+
});
|
|
3312
|
+
await (0, error_js_1.raiseForStatus)(res, "get latest commit hash");
|
|
3313
|
+
return res;
|
|
3314
|
+
});
|
|
3315
|
+
const json = await response.json();
|
|
2744
3316
|
if (json.commits.length === 0) {
|
|
2745
3317
|
return undefined;
|
|
2746
3318
|
}
|
|
@@ -2748,15 +3320,19 @@ class Client {
|
|
|
2748
3320
|
}
|
|
2749
3321
|
async _likeOrUnlikePrompt(promptIdentifier, like) {
|
|
2750
3322
|
const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
2751
|
-
const
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
3323
|
+
const body = JSON.stringify({ like: like });
|
|
3324
|
+
const response = await this.caller.call(async () => {
|
|
3325
|
+
const res = await this._fetch(`${this.apiUrl}/likes/${owner}/${promptName}`, {
|
|
3326
|
+
method: "POST",
|
|
3327
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3328
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3329
|
+
...this.fetchOptions,
|
|
3330
|
+
body,
|
|
3331
|
+
});
|
|
3332
|
+
await (0, error_js_1.raiseForStatus)(res, `${like ? "like" : "unlike"} prompt`);
|
|
3333
|
+
return res;
|
|
3334
|
+
});
|
|
3335
|
+
return response.json();
|
|
2760
3336
|
}
|
|
2761
3337
|
async _getPromptUrl(promptIdentifier) {
|
|
2762
3338
|
const [owner, promptName, commitHash] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
@@ -2810,18 +3386,21 @@ class Client {
|
|
|
2810
3386
|
}
|
|
2811
3387
|
async getPrompt(promptIdentifier) {
|
|
2812
3388
|
const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
2813
|
-
const response = await this.caller.call(
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
3389
|
+
const response = await this.caller.call(async () => {
|
|
3390
|
+
const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3391
|
+
method: "GET",
|
|
3392
|
+
headers: this.headers,
|
|
3393
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3394
|
+
...this.fetchOptions,
|
|
3395
|
+
});
|
|
3396
|
+
if (res?.status === 404) {
|
|
3397
|
+
return null;
|
|
3398
|
+
}
|
|
3399
|
+
await (0, error_js_1.raiseForStatus)(res, "get prompt");
|
|
3400
|
+
return res;
|
|
2818
3401
|
});
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
}
|
|
2822
|
-
await (0, error_js_1.raiseForStatus)(response, "get prompt");
|
|
2823
|
-
const result = await response.json();
|
|
2824
|
-
if (result.repo) {
|
|
3402
|
+
const result = await response?.json();
|
|
3403
|
+
if (result?.repo) {
|
|
2825
3404
|
return result.repo;
|
|
2826
3405
|
}
|
|
2827
3406
|
else {
|
|
@@ -2832,7 +3411,7 @@ class Client {
|
|
|
2832
3411
|
const settings = await this._getSettings();
|
|
2833
3412
|
if (options?.isPublic && !settings.tenant_handle) {
|
|
2834
3413
|
throw new Error(`Cannot create a public prompt without first\n
|
|
2835
|
-
creating a LangChain Hub handle.
|
|
3414
|
+
creating a LangChain Hub handle.
|
|
2836
3415
|
You can add a handle by creating a public prompt at:\n
|
|
2837
3416
|
https://smith.langchain.com/prompts`);
|
|
2838
3417
|
}
|
|
@@ -2847,14 +3426,18 @@ class Client {
|
|
|
2847
3426
|
...(options?.tags && { tags: options.tags }),
|
|
2848
3427
|
is_public: !!options?.isPublic,
|
|
2849
3428
|
};
|
|
2850
|
-
const
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
3429
|
+
const body = JSON.stringify(data);
|
|
3430
|
+
const response = await this.caller.call(async () => {
|
|
3431
|
+
const res = await this._fetch(`${this.apiUrl}/repos/`, {
|
|
3432
|
+
method: "POST",
|
|
3433
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3434
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3435
|
+
...this.fetchOptions,
|
|
3436
|
+
body,
|
|
3437
|
+
});
|
|
3438
|
+
await (0, error_js_1.raiseForStatus)(res, "create prompt");
|
|
3439
|
+
return res;
|
|
3440
|
+
});
|
|
2858
3441
|
const { repo } = await response.json();
|
|
2859
3442
|
return repo;
|
|
2860
3443
|
}
|
|
@@ -2870,14 +3453,18 @@ class Client {
|
|
|
2870
3453
|
manifest: JSON.parse(JSON.stringify(object)),
|
|
2871
3454
|
parent_commit: resolvedParentCommitHash,
|
|
2872
3455
|
};
|
|
2873
|
-
const
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
3456
|
+
const body = JSON.stringify(payload);
|
|
3457
|
+
const response = await this.caller.call(async () => {
|
|
3458
|
+
const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}`, {
|
|
3459
|
+
method: "POST",
|
|
3460
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3461
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3462
|
+
...this.fetchOptions,
|
|
3463
|
+
body,
|
|
3464
|
+
});
|
|
3465
|
+
await (0, error_js_1.raiseForStatus)(res, "create commit");
|
|
3466
|
+
return res;
|
|
3467
|
+
});
|
|
2881
3468
|
const result = await response.json();
|
|
2882
3469
|
return this._getPromptUrl(`${owner}/${promptName}${result.commit_hash ? `:${result.commit_hash}` : ""}`);
|
|
2883
3470
|
}
|
|
@@ -2890,8 +3477,8 @@ class Client {
|
|
|
2890
3477
|
return this._updateExamplesMultipart(datasetId, updates);
|
|
2891
3478
|
}
|
|
2892
3479
|
async _updateExamplesMultipart(datasetId, updates = []) {
|
|
2893
|
-
if (!(await this.
|
|
2894
|
-
throw new Error("Your LangSmith
|
|
3480
|
+
if (!(await this._getDatasetExamplesMultiPartSupport())) {
|
|
3481
|
+
throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
|
|
2895
3482
|
}
|
|
2896
3483
|
const formData = new FormData();
|
|
2897
3484
|
for (const example of updates) {
|
|
@@ -2902,14 +3489,14 @@ class Client {
|
|
|
2902
3489
|
...(example.split && { split: example.split }),
|
|
2903
3490
|
};
|
|
2904
3491
|
// Add main example data
|
|
2905
|
-
const stringifiedExample = (0, index_js_2.serialize)(exampleBody);
|
|
3492
|
+
const stringifiedExample = (0, index_js_2.serialize)(exampleBody, `Serializing body for example with id: ${exampleId}`);
|
|
2906
3493
|
const exampleBlob = new Blob([stringifiedExample], {
|
|
2907
3494
|
type: "application/json",
|
|
2908
3495
|
});
|
|
2909
3496
|
formData.append(exampleId, exampleBlob);
|
|
2910
3497
|
// Add inputs if present
|
|
2911
3498
|
if (example.inputs) {
|
|
2912
|
-
const stringifiedInputs = (0, index_js_2.serialize)(example.inputs);
|
|
3499
|
+
const stringifiedInputs = (0, index_js_2.serialize)(example.inputs, `Serializing inputs for example with id: ${exampleId}`);
|
|
2913
3500
|
const inputsBlob = new Blob([stringifiedInputs], {
|
|
2914
3501
|
type: "application/json",
|
|
2915
3502
|
});
|
|
@@ -2917,7 +3504,7 @@ class Client {
|
|
|
2917
3504
|
}
|
|
2918
3505
|
// Add outputs if present
|
|
2919
3506
|
if (example.outputs) {
|
|
2920
|
-
const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs);
|
|
3507
|
+
const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs, `Serializing outputs whle updating example with id: ${exampleId}`);
|
|
2921
3508
|
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
2922
3509
|
type: "application/json",
|
|
2923
3510
|
});
|
|
@@ -2942,7 +3529,7 @@ class Client {
|
|
|
2942
3529
|
}
|
|
2943
3530
|
}
|
|
2944
3531
|
if (example.attachments_operations) {
|
|
2945
|
-
const stringifiedAttachmentsOperations = (0, index_js_2.serialize)(example.attachments_operations);
|
|
3532
|
+
const stringifiedAttachmentsOperations = (0, index_js_2.serialize)(example.attachments_operations, `Serializing attachments while updating example with id: ${exampleId}`);
|
|
2946
3533
|
const attachmentsOperationsBlob = new Blob([stringifiedAttachmentsOperations], {
|
|
2947
3534
|
type: "application/json",
|
|
2948
3535
|
});
|
|
@@ -2950,13 +3537,18 @@ class Client {
|
|
|
2950
3537
|
}
|
|
2951
3538
|
}
|
|
2952
3539
|
const datasetIdToUse = datasetId ?? updates[0]?.dataset_id;
|
|
2953
|
-
const response = await this.caller.call(
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
3540
|
+
const response = await this.caller.call(async () => {
|
|
3541
|
+
const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetIdToUse}/examples`)}`, {
|
|
3542
|
+
method: "PATCH",
|
|
3543
|
+
headers: this.headers,
|
|
3544
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3545
|
+
...this.fetchOptions,
|
|
3546
|
+
body: formData,
|
|
3547
|
+
});
|
|
3548
|
+
await (0, error_js_1.raiseForStatus)(res, "update examples");
|
|
3549
|
+
return res;
|
|
2957
3550
|
});
|
|
2958
|
-
|
|
2959
|
-
return result;
|
|
3551
|
+
return response.json();
|
|
2960
3552
|
}
|
|
2961
3553
|
/**
|
|
2962
3554
|
* Upload examples with attachments using multipart form data.
|
|
@@ -2968,8 +3560,8 @@ class Client {
|
|
|
2968
3560
|
return this._uploadExamplesMultipart(datasetId, uploads);
|
|
2969
3561
|
}
|
|
2970
3562
|
async _uploadExamplesMultipart(datasetId, uploads = []) {
|
|
2971
|
-
if (!(await this.
|
|
2972
|
-
throw new Error("Your LangSmith
|
|
3563
|
+
if (!(await this._getDatasetExamplesMultiPartSupport())) {
|
|
3564
|
+
throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
|
|
2973
3565
|
}
|
|
2974
3566
|
const formData = new FormData();
|
|
2975
3567
|
for (const example of uploads) {
|
|
@@ -2988,14 +3580,14 @@ class Client {
|
|
|
2988
3580
|
}),
|
|
2989
3581
|
};
|
|
2990
3582
|
// Add main example data
|
|
2991
|
-
const stringifiedExample = (0, index_js_2.serialize)(exampleBody);
|
|
3583
|
+
const stringifiedExample = (0, index_js_2.serialize)(exampleBody, `Serializing body for uploaded example with id: ${exampleId}`);
|
|
2992
3584
|
const exampleBlob = new Blob([stringifiedExample], {
|
|
2993
3585
|
type: "application/json",
|
|
2994
3586
|
});
|
|
2995
3587
|
formData.append(exampleId, exampleBlob);
|
|
2996
3588
|
// Add inputs if present
|
|
2997
3589
|
if (example.inputs) {
|
|
2998
|
-
const stringifiedInputs = (0, index_js_2.serialize)(example.inputs);
|
|
3590
|
+
const stringifiedInputs = (0, index_js_2.serialize)(example.inputs, `Serializing inputs for uploaded example with id: ${exampleId}`);
|
|
2999
3591
|
const inputsBlob = new Blob([stringifiedInputs], {
|
|
3000
3592
|
type: "application/json",
|
|
3001
3593
|
});
|
|
@@ -3003,7 +3595,7 @@ class Client {
|
|
|
3003
3595
|
}
|
|
3004
3596
|
// Add outputs if present
|
|
3005
3597
|
if (example.outputs) {
|
|
3006
|
-
const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs);
|
|
3598
|
+
const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs, `Serializing outputs for uploaded example with id: ${exampleId}`);
|
|
3007
3599
|
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
3008
3600
|
type: "application/json",
|
|
3009
3601
|
});
|
|
@@ -3028,13 +3620,18 @@ class Client {
|
|
|
3028
3620
|
}
|
|
3029
3621
|
}
|
|
3030
3622
|
}
|
|
3031
|
-
const response = await this.caller.call(
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3623
|
+
const response = await this.caller.call(async () => {
|
|
3624
|
+
const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetId}/examples`)}`, {
|
|
3625
|
+
method: "POST",
|
|
3626
|
+
headers: this.headers,
|
|
3627
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3628
|
+
...this.fetchOptions,
|
|
3629
|
+
body: formData,
|
|
3630
|
+
});
|
|
3631
|
+
await (0, error_js_1.raiseForStatus)(res, "upload examples");
|
|
3632
|
+
return res;
|
|
3035
3633
|
});
|
|
3036
|
-
|
|
3037
|
-
return result;
|
|
3634
|
+
return response.json();
|
|
3038
3635
|
}
|
|
3039
3636
|
async updatePrompt(promptIdentifier, options) {
|
|
3040
3637
|
if (!(await this.promptExists(promptIdentifier))) {
|
|
@@ -3059,17 +3656,21 @@ class Client {
|
|
|
3059
3656
|
if (Object.keys(payload).length === 0) {
|
|
3060
3657
|
throw new Error("No valid update options provided");
|
|
3061
3658
|
}
|
|
3062
|
-
const
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3659
|
+
const body = JSON.stringify(payload);
|
|
3660
|
+
const response = await this.caller.call(async () => {
|
|
3661
|
+
const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3662
|
+
method: "PATCH",
|
|
3663
|
+
headers: {
|
|
3664
|
+
...this.headers,
|
|
3665
|
+
"Content-Type": "application/json",
|
|
3666
|
+
},
|
|
3667
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3668
|
+
...this.fetchOptions,
|
|
3669
|
+
body,
|
|
3670
|
+
});
|
|
3671
|
+
await (0, error_js_1.raiseForStatus)(res, "update prompt");
|
|
3672
|
+
return res;
|
|
3071
3673
|
});
|
|
3072
|
-
await (0, error_js_1.raiseForStatus)(response, "update prompt");
|
|
3073
3674
|
return response.json();
|
|
3074
3675
|
}
|
|
3075
3676
|
async deletePrompt(promptIdentifier) {
|
|
@@ -3080,23 +3681,30 @@ class Client {
|
|
|
3080
3681
|
if (!(await this._currentTenantIsOwner(owner))) {
|
|
3081
3682
|
throw await this._ownerConflictError("delete a prompt", owner);
|
|
3082
3683
|
}
|
|
3083
|
-
const response = await this.caller.call(
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3684
|
+
const response = await this.caller.call(async () => {
|
|
3685
|
+
const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3686
|
+
method: "DELETE",
|
|
3687
|
+
headers: this.headers,
|
|
3688
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3689
|
+
...this.fetchOptions,
|
|
3690
|
+
});
|
|
3691
|
+
await (0, error_js_1.raiseForStatus)(res, "delete prompt");
|
|
3692
|
+
return res;
|
|
3088
3693
|
});
|
|
3089
|
-
return
|
|
3694
|
+
return response.json();
|
|
3090
3695
|
}
|
|
3091
3696
|
async pullPromptCommit(promptIdentifier, options) {
|
|
3092
3697
|
const [owner, promptName, commitHash] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
3093
|
-
const response = await this.caller.call(
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3698
|
+
const response = await this.caller.call(async () => {
|
|
3699
|
+
const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
|
|
3700
|
+
method: "GET",
|
|
3701
|
+
headers: this.headers,
|
|
3702
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3703
|
+
...this.fetchOptions,
|
|
3704
|
+
});
|
|
3705
|
+
await (0, error_js_1.raiseForStatus)(res, "pull prompt commit");
|
|
3706
|
+
return res;
|
|
3098
3707
|
});
|
|
3099
|
-
await (0, error_js_1.raiseForStatus)(response, "pull prompt commit");
|
|
3100
3708
|
const result = await response.json();
|
|
3101
3709
|
return {
|
|
3102
3710
|
owner,
|
|
@@ -3249,15 +3857,18 @@ class Client {
|
|
|
3249
3857
|
*
|
|
3250
3858
|
* @returns A promise that resolves once all currently pending traces have sent.
|
|
3251
3859
|
*/
|
|
3252
|
-
awaitPendingTraceBatches() {
|
|
3860
|
+
async awaitPendingTraceBatches() {
|
|
3253
3861
|
if (this.manualFlushMode) {
|
|
3254
3862
|
console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches.");
|
|
3255
3863
|
return Promise.resolve();
|
|
3256
3864
|
}
|
|
3257
|
-
|
|
3865
|
+
await Promise.all([
|
|
3258
3866
|
...this.autoBatchQueue.items.map(({ itemPromise }) => itemPromise),
|
|
3259
3867
|
this.batchIngestCaller.queue.onIdle(),
|
|
3260
3868
|
]);
|
|
3869
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
3870
|
+
await (0, otel_js_1.getDefaultOTLPTracerComponents)()?.DEFAULT_LANGSMITH_SPAN_PROCESSOR?.forceFlush();
|
|
3871
|
+
}
|
|
3261
3872
|
}
|
|
3262
3873
|
}
|
|
3263
3874
|
exports.Client = Client;
|