@nocobase/plugin-ai 1.9.32 → 1.9.34
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
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import * as uuid from "uuid";
|
|
2
|
+
import { LangSmithToOTELTranslator, } from "./experimental/otel/translator.js";
|
|
3
|
+
import { getDefaultOTLPTracerComponents, getOTELTrace, getOTELContext, } from "./singletons/otel.js";
|
|
2
4
|
import { AsyncCaller } from "./utils/async_caller.js";
|
|
3
5
|
import { convertLangChainMessageToExample, isLangChainMessage, } from "./utils/messages.js";
|
|
4
|
-
import { getEnvironmentVariable,
|
|
6
|
+
import { getEnvironmentVariable, getLangSmithEnvVarsMetadata, getLangSmithEnvironmentVariable, getRuntimeEnvironment, getOtelEnabled, getEnv, } from "./utils/env.js";
|
|
5
7
|
import { __version__ } from "./index.js";
|
|
6
8
|
import { assertUuid } from "./utils/_uuid.js";
|
|
7
9
|
import { warnOnce } from "./utils/warn.js";
|
|
8
10
|
import { parsePromptIdentifier } from "./utils/prompts.js";
|
|
9
11
|
import { raiseForStatus } from "./utils/error.js";
|
|
10
|
-
import { _getFetchImplementation } from "./singletons/fetch.js";
|
|
12
|
+
import { _globalFetchImplementationIsNodeFetch, _getFetchImplementation, } from "./singletons/fetch.js";
|
|
11
13
|
import { serialize as serializePayloadForTracing } from "./utils/fast-safe-stringify/index.js";
|
|
12
|
-
export function
|
|
14
|
+
export function mergeRuntimeEnvIntoRun(run, cachedEnvVars) {
|
|
13
15
|
const runtimeEnv = getRuntimeEnvironment();
|
|
14
|
-
const envVars =
|
|
16
|
+
const envVars = cachedEnvVars ?? getLangSmithEnvVarsMetadata();
|
|
15
17
|
const extra = run.extra ?? {};
|
|
16
18
|
const metadata = extra.metadata;
|
|
17
19
|
run.extra = {
|
|
@@ -22,16 +24,20 @@ export function mergeRuntimeEnvIntoRunCreate(run) {
|
|
|
22
24
|
},
|
|
23
25
|
metadata: {
|
|
24
26
|
...envVars,
|
|
25
|
-
...(envVars.revision_id || run.revision_id
|
|
26
|
-
? {
|
|
27
|
+
...(envVars.revision_id || ("revision_id" in run && run.revision_id)
|
|
28
|
+
? {
|
|
29
|
+
revision_id: ("revision_id" in run ? run.revision_id : undefined) ??
|
|
30
|
+
envVars.revision_id,
|
|
31
|
+
}
|
|
27
32
|
: {}),
|
|
28
33
|
...metadata,
|
|
29
34
|
},
|
|
30
35
|
};
|
|
31
36
|
return run;
|
|
32
37
|
}
|
|
33
|
-
const getTracingSamplingRate = () => {
|
|
34
|
-
const samplingRateStr =
|
|
38
|
+
const getTracingSamplingRate = (configRate) => {
|
|
39
|
+
const samplingRateStr = configRate?.toString() ??
|
|
40
|
+
getLangSmithEnvironmentVariable("TRACING_SAMPLING_RATE");
|
|
35
41
|
if (samplingRateStr === undefined) {
|
|
36
42
|
return undefined;
|
|
37
43
|
}
|
|
@@ -65,7 +71,7 @@ function trimQuotes(str) {
|
|
|
65
71
|
}
|
|
66
72
|
const handle429 = async (response) => {
|
|
67
73
|
if (response?.status === 429) {
|
|
68
|
-
const retryAfter = parseInt(response.headers.get("retry-after") ?? "
|
|
74
|
+
const retryAfter = parseInt(response.headers.get("retry-after") ?? "10", 10) * 1000;
|
|
69
75
|
if (retryAfter > 0) {
|
|
70
76
|
await new Promise((resolve) => setTimeout(resolve, retryAfter));
|
|
71
77
|
// Return directly after calling this check
|
|
@@ -75,6 +81,13 @@ const handle429 = async (response) => {
|
|
|
75
81
|
// Fall back to existing status checks
|
|
76
82
|
return false;
|
|
77
83
|
};
|
|
84
|
+
function _formatFeedbackScore(score) {
|
|
85
|
+
if (typeof score === "number") {
|
|
86
|
+
// Truncate at 4 decimal places
|
|
87
|
+
return Number(score.toFixed(4));
|
|
88
|
+
}
|
|
89
|
+
return score;
|
|
90
|
+
}
|
|
78
91
|
export class AutoBatchQueue {
|
|
79
92
|
constructor() {
|
|
80
93
|
Object.defineProperty(this, "items", {
|
|
@@ -100,10 +113,13 @@ export class AutoBatchQueue {
|
|
|
100
113
|
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise
|
|
101
114
|
itemPromiseResolve = resolve;
|
|
102
115
|
});
|
|
103
|
-
const size = serializePayloadForTracing(item.item).length;
|
|
116
|
+
const size = serializePayloadForTracing(item.item, `Serializing run with id: ${item.item.id}`).length;
|
|
104
117
|
this.items.push({
|
|
105
118
|
action: item.action,
|
|
106
119
|
payload: item.item,
|
|
120
|
+
otelContext: item.otelContext,
|
|
121
|
+
apiKey: item.apiKey,
|
|
122
|
+
apiUrl: item.apiUrl,
|
|
107
123
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
108
124
|
itemPromiseResolve: itemPromiseResolve,
|
|
109
125
|
itemPromise,
|
|
@@ -112,7 +128,7 @@ export class AutoBatchQueue {
|
|
|
112
128
|
this.sizeBytes += size;
|
|
113
129
|
return itemPromise;
|
|
114
130
|
}
|
|
115
|
-
pop(upToSizeBytes) {
|
|
131
|
+
pop({ upToSizeBytes, upToSize, }) {
|
|
116
132
|
if (upToSizeBytes < 1) {
|
|
117
133
|
throw new Error("Number of bytes to pop off may not be less than 1.");
|
|
118
134
|
}
|
|
@@ -120,7 +136,8 @@ export class AutoBatchQueue {
|
|
|
120
136
|
let poppedSizeBytes = 0;
|
|
121
137
|
// Pop items until we reach or exceed the size limit
|
|
122
138
|
while (poppedSizeBytes + (this.peek()?.size ?? 0) < upToSizeBytes &&
|
|
123
|
-
this.items.length > 0
|
|
139
|
+
this.items.length > 0 &&
|
|
140
|
+
popped.length < upToSize) {
|
|
124
141
|
const item = this.items.shift();
|
|
125
142
|
if (item) {
|
|
126
143
|
popped.push(item);
|
|
@@ -137,15 +154,26 @@ export class AutoBatchQueue {
|
|
|
137
154
|
this.sizeBytes -= item.size;
|
|
138
155
|
}
|
|
139
156
|
return [
|
|
140
|
-
popped.map((it) => ({
|
|
157
|
+
popped.map((it) => ({
|
|
158
|
+
action: it.action,
|
|
159
|
+
item: it.payload,
|
|
160
|
+
otelContext: it.otelContext,
|
|
161
|
+
apiKey: it.apiKey,
|
|
162
|
+
apiUrl: it.apiUrl,
|
|
163
|
+
})),
|
|
141
164
|
() => popped.forEach((it) => it.itemPromiseResolve()),
|
|
142
165
|
];
|
|
143
166
|
}
|
|
144
167
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
168
|
+
export const DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES = 24 * 1024 * 1024;
|
|
169
|
+
const SERVER_INFO_REQUEST_TIMEOUT_MS = 10000;
|
|
170
|
+
/** Maximum number of operations to batch in a single request. */
|
|
171
|
+
const DEFAULT_BATCH_SIZE_LIMIT = 100;
|
|
172
|
+
const DEFAULT_API_URL = "https://api.smith.langchain.com";
|
|
148
173
|
export class Client {
|
|
174
|
+
get _fetch() {
|
|
175
|
+
return this.fetchImplementation || _getFetchImplementation(this.debug);
|
|
176
|
+
}
|
|
149
177
|
constructor(config = {}) {
|
|
150
178
|
Object.defineProperty(this, "apiKey", {
|
|
151
179
|
enumerable: true,
|
|
@@ -165,6 +193,12 @@ export class Client {
|
|
|
165
193
|
writable: true,
|
|
166
194
|
value: void 0
|
|
167
195
|
});
|
|
196
|
+
Object.defineProperty(this, "workspaceId", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
configurable: true,
|
|
199
|
+
writable: true,
|
|
200
|
+
value: void 0
|
|
201
|
+
});
|
|
168
202
|
Object.defineProperty(this, "caller", {
|
|
169
203
|
enumerable: true,
|
|
170
204
|
configurable: true,
|
|
@@ -243,6 +277,12 @@ export class Client {
|
|
|
243
277
|
writable: true,
|
|
244
278
|
value: void 0
|
|
245
279
|
});
|
|
280
|
+
Object.defineProperty(this, "batchSizeLimit", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
configurable: true,
|
|
283
|
+
writable: true,
|
|
284
|
+
value: void 0
|
|
285
|
+
});
|
|
246
286
|
Object.defineProperty(this, "fetchOptions", {
|
|
247
287
|
enumerable: true,
|
|
248
288
|
configurable: true,
|
|
@@ -286,8 +326,38 @@ export class Client {
|
|
|
286
326
|
writable: true,
|
|
287
327
|
value: false
|
|
288
328
|
});
|
|
329
|
+
Object.defineProperty(this, "langSmithToOTELTranslator", {
|
|
330
|
+
enumerable: true,
|
|
331
|
+
configurable: true,
|
|
332
|
+
writable: true,
|
|
333
|
+
value: void 0
|
|
334
|
+
});
|
|
335
|
+
Object.defineProperty(this, "fetchImplementation", {
|
|
336
|
+
enumerable: true,
|
|
337
|
+
configurable: true,
|
|
338
|
+
writable: true,
|
|
339
|
+
value: void 0
|
|
340
|
+
});
|
|
341
|
+
Object.defineProperty(this, "cachedLSEnvVarsForMetadata", {
|
|
342
|
+
enumerable: true,
|
|
343
|
+
configurable: true,
|
|
344
|
+
writable: true,
|
|
345
|
+
value: void 0
|
|
346
|
+
});
|
|
347
|
+
Object.defineProperty(this, "multipartStreamingDisabled", {
|
|
348
|
+
enumerable: true,
|
|
349
|
+
configurable: true,
|
|
350
|
+
writable: true,
|
|
351
|
+
value: false
|
|
352
|
+
});
|
|
353
|
+
Object.defineProperty(this, "debug", {
|
|
354
|
+
enumerable: true,
|
|
355
|
+
configurable: true,
|
|
356
|
+
writable: true,
|
|
357
|
+
value: getEnvironmentVariable("LANGSMITH_DEBUG") === "true"
|
|
358
|
+
});
|
|
289
359
|
const defaultConfig = Client.getDefaultClientConfig();
|
|
290
|
-
this.tracingSampleRate = getTracingSamplingRate();
|
|
360
|
+
this.tracingSampleRate = getTracingSamplingRate(config.tracingSamplingRate);
|
|
291
361
|
this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? "";
|
|
292
362
|
if (this.apiUrl.endsWith("/")) {
|
|
293
363
|
this.apiUrl = this.apiUrl.slice(0, -1);
|
|
@@ -297,18 +367,26 @@ export class Client {
|
|
|
297
367
|
if (this.webUrl?.endsWith("/")) {
|
|
298
368
|
this.webUrl = this.webUrl.slice(0, -1);
|
|
299
369
|
}
|
|
370
|
+
this.workspaceId = trimQuotes(config.workspaceId ?? getLangSmithEnvironmentVariable("WORKSPACE_ID"));
|
|
300
371
|
this.timeout_ms = config.timeout_ms ?? 90_000;
|
|
301
|
-
this.caller = new AsyncCaller(
|
|
372
|
+
this.caller = new AsyncCaller({
|
|
373
|
+
...(config.callerOptions ?? {}),
|
|
374
|
+
maxRetries: 4,
|
|
375
|
+
debug: config.debug ?? this.debug,
|
|
376
|
+
});
|
|
302
377
|
this.traceBatchConcurrency =
|
|
303
378
|
config.traceBatchConcurrency ?? this.traceBatchConcurrency;
|
|
304
379
|
if (this.traceBatchConcurrency < 1) {
|
|
305
380
|
throw new Error("Trace batch concurrency must be positive.");
|
|
306
381
|
}
|
|
382
|
+
this.debug = config.debug ?? this.debug;
|
|
383
|
+
this.fetchImplementation = config.fetchImplementation;
|
|
307
384
|
this.batchIngestCaller = new AsyncCaller({
|
|
308
385
|
maxRetries: 2,
|
|
309
386
|
maxConcurrency: this.traceBatchConcurrency,
|
|
310
387
|
...(config.callerOptions ?? {}),
|
|
311
388
|
onFailedResponseHook: handle429,
|
|
389
|
+
debug: config.debug ?? this.debug,
|
|
312
390
|
});
|
|
313
391
|
this.hideInputs =
|
|
314
392
|
config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs;
|
|
@@ -318,13 +396,18 @@ export class Client {
|
|
|
318
396
|
this.blockOnRootRunFinalization =
|
|
319
397
|
config.blockOnRootRunFinalization ?? this.blockOnRootRunFinalization;
|
|
320
398
|
this.batchSizeBytesLimit = config.batchSizeBytesLimit;
|
|
399
|
+
this.batchSizeLimit = config.batchSizeLimit;
|
|
321
400
|
this.fetchOptions = config.fetchOptions || {};
|
|
322
401
|
this.manualFlushMode = config.manualFlushMode ?? this.manualFlushMode;
|
|
402
|
+
if (getOtelEnabled()) {
|
|
403
|
+
this.langSmithToOTELTranslator = new LangSmithToOTELTranslator();
|
|
404
|
+
}
|
|
405
|
+
// Cache metadata env vars once during construction to avoid repeatedly scanning process.env
|
|
406
|
+
this.cachedLSEnvVarsForMetadata = getLangSmithEnvVarsMetadata();
|
|
323
407
|
}
|
|
324
408
|
static getDefaultClientConfig() {
|
|
325
409
|
const apiKey = getLangSmithEnvironmentVariable("API_KEY");
|
|
326
|
-
const apiUrl = getLangSmithEnvironmentVariable("ENDPOINT") ??
|
|
327
|
-
"https://api.smith.langchain.com";
|
|
410
|
+
const apiUrl = getLangSmithEnvironmentVariable("ENDPOINT") ?? DEFAULT_API_URL;
|
|
328
411
|
const hideInputs = getLangSmithEnvironmentVariable("HIDE_INPUTS") === "true";
|
|
329
412
|
const hideOutputs = getLangSmithEnvironmentVariable("HIDE_OUTPUTS") === "true";
|
|
330
413
|
return {
|
|
@@ -376,9 +459,17 @@ export class Client {
|
|
|
376
459
|
if (this.apiKey) {
|
|
377
460
|
headers["x-api-key"] = `${this.apiKey}`;
|
|
378
461
|
}
|
|
462
|
+
if (this.workspaceId) {
|
|
463
|
+
headers["x-tenant-id"] = this.workspaceId;
|
|
464
|
+
}
|
|
379
465
|
return headers;
|
|
380
466
|
}
|
|
381
|
-
|
|
467
|
+
_getPlatformEndpointPath(path) {
|
|
468
|
+
// Check if apiUrl already ends with /v1 or /v1/ to avoid double /v1/v1/ paths
|
|
469
|
+
const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
|
|
470
|
+
return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
|
|
471
|
+
}
|
|
472
|
+
async processInputs(inputs) {
|
|
382
473
|
if (this.hideInputs === false) {
|
|
383
474
|
return inputs;
|
|
384
475
|
}
|
|
@@ -390,7 +481,7 @@ export class Client {
|
|
|
390
481
|
}
|
|
391
482
|
return inputs;
|
|
392
483
|
}
|
|
393
|
-
processOutputs(outputs) {
|
|
484
|
+
async processOutputs(outputs) {
|
|
394
485
|
if (this.hideOutputs === false) {
|
|
395
486
|
return outputs;
|
|
396
487
|
}
|
|
@@ -402,26 +493,29 @@ export class Client {
|
|
|
402
493
|
}
|
|
403
494
|
return outputs;
|
|
404
495
|
}
|
|
405
|
-
prepareRunCreateOrUpdateInputs(run) {
|
|
496
|
+
async prepareRunCreateOrUpdateInputs(run) {
|
|
406
497
|
const runParams = { ...run };
|
|
407
498
|
if (runParams.inputs !== undefined) {
|
|
408
|
-
runParams.inputs = this.processInputs(runParams.inputs);
|
|
499
|
+
runParams.inputs = await this.processInputs(runParams.inputs);
|
|
409
500
|
}
|
|
410
501
|
if (runParams.outputs !== undefined) {
|
|
411
|
-
runParams.outputs = this.processOutputs(runParams.outputs);
|
|
502
|
+
runParams.outputs = await this.processOutputs(runParams.outputs);
|
|
412
503
|
}
|
|
413
504
|
return runParams;
|
|
414
505
|
}
|
|
415
506
|
async _getResponse(path, queryParams) {
|
|
416
507
|
const paramsString = queryParams?.toString() ?? "";
|
|
417
508
|
const url = `${this.apiUrl}${path}?${paramsString}`;
|
|
418
|
-
const response = await this.caller.call(
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
509
|
+
const response = await this.caller.call(async () => {
|
|
510
|
+
const res = await this._fetch(url, {
|
|
511
|
+
method: "GET",
|
|
512
|
+
headers: this.headers,
|
|
513
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
514
|
+
...this.fetchOptions,
|
|
515
|
+
});
|
|
516
|
+
await raiseForStatus(res, `fetch ${path}`);
|
|
517
|
+
return res;
|
|
423
518
|
});
|
|
424
|
-
await raiseForStatus(response, `Failed to fetch ${path}`);
|
|
425
519
|
return response;
|
|
426
520
|
}
|
|
427
521
|
async _get(path, queryParams) {
|
|
@@ -435,13 +529,16 @@ export class Client {
|
|
|
435
529
|
queryParams.set("offset", String(offset));
|
|
436
530
|
queryParams.set("limit", String(limit));
|
|
437
531
|
const url = `${this.apiUrl}${path}?${queryParams}`;
|
|
438
|
-
const response = await this.caller.call(
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
532
|
+
const response = await this.caller.call(async () => {
|
|
533
|
+
const res = await this._fetch(url, {
|
|
534
|
+
method: "GET",
|
|
535
|
+
headers: this.headers,
|
|
536
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
537
|
+
...this.fetchOptions,
|
|
538
|
+
});
|
|
539
|
+
await raiseForStatus(res, `fetch ${path}`);
|
|
540
|
+
return res;
|
|
443
541
|
});
|
|
444
|
-
await raiseForStatus(response, `Failed to fetch ${path}`);
|
|
445
542
|
const items = transform
|
|
446
543
|
? transform(await response.json())
|
|
447
544
|
: await response.json();
|
|
@@ -458,12 +555,17 @@ export class Client {
|
|
|
458
555
|
async *_getCursorPaginatedList(path, body = null, requestMethod = "POST", dataKey = "runs") {
|
|
459
556
|
const bodyParams = body ? { ...body } : {};
|
|
460
557
|
while (true) {
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
558
|
+
const body = JSON.stringify(bodyParams);
|
|
559
|
+
const response = await this.caller.call(async () => {
|
|
560
|
+
const res = await this._fetch(`${this.apiUrl}${path}`, {
|
|
561
|
+
method: requestMethod,
|
|
562
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
563
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
564
|
+
...this.fetchOptions,
|
|
565
|
+
body,
|
|
566
|
+
});
|
|
567
|
+
await raiseForStatus(res, `fetch ${path}`);
|
|
568
|
+
return res;
|
|
467
569
|
});
|
|
468
570
|
const responseBody = await response.json();
|
|
469
571
|
if (!responseBody) {
|
|
@@ -483,6 +585,13 @@ export class Client {
|
|
|
483
585
|
bodyParams.cursor = cursors.next;
|
|
484
586
|
}
|
|
485
587
|
}
|
|
588
|
+
// Allows mocking for tests
|
|
589
|
+
_shouldSample() {
|
|
590
|
+
if (this.tracingSampleRate === undefined) {
|
|
591
|
+
return true;
|
|
592
|
+
}
|
|
593
|
+
return Math.random() < this.tracingSampleRate;
|
|
594
|
+
}
|
|
486
595
|
_filterForSampling(runs, patch = false) {
|
|
487
596
|
if (this.tracingSampleRate === undefined) {
|
|
488
597
|
return runs;
|
|
@@ -490,25 +599,36 @@ export class Client {
|
|
|
490
599
|
if (patch) {
|
|
491
600
|
const sampled = [];
|
|
492
601
|
for (const run of runs) {
|
|
493
|
-
if (!this.filteredPostUuids.has(run.
|
|
602
|
+
if (!this.filteredPostUuids.has(run.trace_id)) {
|
|
494
603
|
sampled.push(run);
|
|
495
604
|
}
|
|
496
|
-
else {
|
|
497
|
-
this.filteredPostUuids.delete(run.
|
|
605
|
+
else if (run.id === run.trace_id) {
|
|
606
|
+
this.filteredPostUuids.delete(run.trace_id);
|
|
498
607
|
}
|
|
499
608
|
}
|
|
500
609
|
return sampled;
|
|
501
610
|
}
|
|
502
611
|
else {
|
|
612
|
+
// For new runs, sample at trace level to maintain consistency
|
|
503
613
|
const sampled = [];
|
|
504
614
|
for (const run of runs) {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
615
|
+
const traceId = run.trace_id ?? run.id;
|
|
616
|
+
// If we've already made a decision about this trace, follow it
|
|
617
|
+
if (this.filteredPostUuids.has(traceId)) {
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
// For new traces, apply sampling
|
|
621
|
+
if (run.id === traceId) {
|
|
622
|
+
if (this._shouldSample()) {
|
|
623
|
+
sampled.push(run);
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
this.filteredPostUuids.add(traceId);
|
|
627
|
+
}
|
|
509
628
|
}
|
|
510
629
|
else {
|
|
511
|
-
|
|
630
|
+
// Child runs follow their trace's sampling decision
|
|
631
|
+
sampled.push(run);
|
|
512
632
|
}
|
|
513
633
|
}
|
|
514
634
|
return sampled;
|
|
@@ -518,83 +638,163 @@ export class Client {
|
|
|
518
638
|
const serverInfo = await this._ensureServerInfo();
|
|
519
639
|
return (this.batchSizeBytesLimit ??
|
|
520
640
|
serverInfo.batch_ingest_config?.size_limit_bytes ??
|
|
521
|
-
|
|
641
|
+
DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES);
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Get the maximum number of operations to batch in a single request.
|
|
645
|
+
*/
|
|
646
|
+
async _getBatchSizeLimit() {
|
|
647
|
+
const serverInfo = await this._ensureServerInfo();
|
|
648
|
+
return (this.batchSizeLimit ??
|
|
649
|
+
serverInfo.batch_ingest_config?.size_limit ??
|
|
650
|
+
DEFAULT_BATCH_SIZE_LIMIT);
|
|
522
651
|
}
|
|
523
|
-
async
|
|
652
|
+
async _getDatasetExamplesMultiPartSupport() {
|
|
524
653
|
const serverInfo = await this._ensureServerInfo();
|
|
525
654
|
return (serverInfo.instance_flags?.dataset_examples_multipart_enabled ?? false);
|
|
526
655
|
}
|
|
527
|
-
drainAutoBatchQueue(batchSizeLimit) {
|
|
656
|
+
drainAutoBatchQueue({ batchSizeLimitBytes, batchSizeLimit, }) {
|
|
528
657
|
const promises = [];
|
|
529
658
|
while (this.autoBatchQueue.items.length > 0) {
|
|
530
|
-
const [batch, done] = this.autoBatchQueue.pop(
|
|
659
|
+
const [batch, done] = this.autoBatchQueue.pop({
|
|
660
|
+
upToSizeBytes: batchSizeLimitBytes,
|
|
661
|
+
upToSize: batchSizeLimit,
|
|
662
|
+
});
|
|
531
663
|
if (!batch.length) {
|
|
532
664
|
done();
|
|
533
665
|
break;
|
|
534
666
|
}
|
|
535
|
-
const
|
|
536
|
-
|
|
667
|
+
const batchesByDestination = batch.reduce((acc, item) => {
|
|
668
|
+
const apiUrl = item.apiUrl ?? this.apiUrl;
|
|
669
|
+
const apiKey = item.apiKey ?? this.apiKey;
|
|
670
|
+
const isDefault = item.apiKey === this.apiKey && item.apiUrl === this.apiUrl;
|
|
671
|
+
const batchKey = isDefault ? "default" : `${apiUrl}|${apiKey}`;
|
|
672
|
+
if (!acc[batchKey]) {
|
|
673
|
+
acc[batchKey] = [];
|
|
674
|
+
}
|
|
675
|
+
acc[batchKey].push(item);
|
|
676
|
+
return acc;
|
|
677
|
+
}, {});
|
|
678
|
+
const batchPromises = [];
|
|
679
|
+
for (const [batchKey, batch] of Object.entries(batchesByDestination)) {
|
|
680
|
+
const batchPromise = this._processBatch(batch, {
|
|
681
|
+
apiUrl: batchKey === "default" ? undefined : batchKey.split("|")[0],
|
|
682
|
+
apiKey: batchKey === "default" ? undefined : batchKey.split("|")[1],
|
|
683
|
+
});
|
|
684
|
+
batchPromises.push(batchPromise);
|
|
685
|
+
}
|
|
686
|
+
// Wait for all batches to complete, then call the overall done callback
|
|
687
|
+
const allBatchesPromise = Promise.all(batchPromises).finally(done);
|
|
688
|
+
promises.push(allBatchesPromise);
|
|
537
689
|
}
|
|
538
690
|
return Promise.all(promises);
|
|
539
691
|
}
|
|
540
|
-
async _processBatch(batch,
|
|
692
|
+
async _processBatch(batch, options) {
|
|
541
693
|
if (!batch.length) {
|
|
542
|
-
done();
|
|
543
694
|
return;
|
|
544
695
|
}
|
|
545
696
|
try {
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
.filter((item) => item.action === "create")
|
|
549
|
-
.map((item) => item.item),
|
|
550
|
-
runUpdates: batch
|
|
551
|
-
.filter((item) => item.action === "update")
|
|
552
|
-
.map((item) => item.item),
|
|
553
|
-
};
|
|
554
|
-
const serverInfo = await this._ensureServerInfo();
|
|
555
|
-
if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
|
|
556
|
-
await this.multipartIngestRuns(ingestParams);
|
|
697
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
698
|
+
this._sendBatchToOTELTranslator(batch);
|
|
557
699
|
}
|
|
558
700
|
else {
|
|
559
|
-
|
|
701
|
+
const ingestParams = {
|
|
702
|
+
runCreates: batch
|
|
703
|
+
.filter((item) => item.action === "create")
|
|
704
|
+
.map((item) => item.item),
|
|
705
|
+
runUpdates: batch
|
|
706
|
+
.filter((item) => item.action === "update")
|
|
707
|
+
.map((item) => item.item),
|
|
708
|
+
};
|
|
709
|
+
const serverInfo = await this._ensureServerInfo();
|
|
710
|
+
if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
|
|
711
|
+
const useGzip = serverInfo?.instance_flags?.gzip_body_enabled;
|
|
712
|
+
await this.multipartIngestRuns(ingestParams, { ...options, useGzip });
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
await this.batchIngestRuns(ingestParams, options);
|
|
716
|
+
}
|
|
560
717
|
}
|
|
561
718
|
}
|
|
562
|
-
|
|
563
|
-
|
|
719
|
+
catch (e) {
|
|
720
|
+
console.error("Error exporting batch:", e);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
_sendBatchToOTELTranslator(batch) {
|
|
724
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
725
|
+
const otelContextMap = new Map();
|
|
726
|
+
const operations = [];
|
|
727
|
+
for (const item of batch) {
|
|
728
|
+
if (item.item.id && item.otelContext) {
|
|
729
|
+
otelContextMap.set(item.item.id, item.otelContext);
|
|
730
|
+
if (item.action === "create") {
|
|
731
|
+
operations.push({
|
|
732
|
+
operation: "post",
|
|
733
|
+
id: item.item.id,
|
|
734
|
+
trace_id: item.item.trace_id ?? item.item.id,
|
|
735
|
+
run: item.item,
|
|
736
|
+
});
|
|
737
|
+
}
|
|
738
|
+
else {
|
|
739
|
+
operations.push({
|
|
740
|
+
operation: "patch",
|
|
741
|
+
id: item.item.id,
|
|
742
|
+
trace_id: item.item.trace_id ?? item.item.id,
|
|
743
|
+
run: item.item,
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
this.langSmithToOTELTranslator.exportBatch(operations, otelContextMap);
|
|
564
749
|
}
|
|
565
750
|
}
|
|
566
751
|
async processRunOperation(item) {
|
|
567
752
|
clearTimeout(this.autoBatchTimeout);
|
|
568
753
|
this.autoBatchTimeout = undefined;
|
|
569
|
-
|
|
570
|
-
item.item = mergeRuntimeEnvIntoRunCreate(item.item);
|
|
571
|
-
}
|
|
754
|
+
item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata);
|
|
572
755
|
const itemPromise = this.autoBatchQueue.push(item);
|
|
573
756
|
if (this.manualFlushMode) {
|
|
574
757
|
// Rely on manual flushing in serverless environments
|
|
575
758
|
return itemPromise;
|
|
576
759
|
}
|
|
577
760
|
const sizeLimitBytes = await this._getBatchSizeLimitBytes();
|
|
578
|
-
|
|
579
|
-
|
|
761
|
+
const sizeLimit = await this._getBatchSizeLimit();
|
|
762
|
+
if (this.autoBatchQueue.sizeBytes > sizeLimitBytes ||
|
|
763
|
+
this.autoBatchQueue.items.length > sizeLimit) {
|
|
764
|
+
void this.drainAutoBatchQueue({
|
|
765
|
+
batchSizeLimitBytes: sizeLimitBytes,
|
|
766
|
+
batchSizeLimit: sizeLimit,
|
|
767
|
+
});
|
|
580
768
|
}
|
|
581
769
|
if (this.autoBatchQueue.items.length > 0) {
|
|
582
770
|
this.autoBatchTimeout = setTimeout(() => {
|
|
583
771
|
this.autoBatchTimeout = undefined;
|
|
584
|
-
void this.drainAutoBatchQueue(
|
|
772
|
+
void this.drainAutoBatchQueue({
|
|
773
|
+
batchSizeLimitBytes: sizeLimitBytes,
|
|
774
|
+
batchSizeLimit: sizeLimit,
|
|
775
|
+
});
|
|
585
776
|
}, this.autoBatchAggregationDelayMs);
|
|
586
777
|
}
|
|
587
778
|
return itemPromise;
|
|
588
779
|
}
|
|
589
780
|
async _getServerInfo() {
|
|
590
|
-
const response = await
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
781
|
+
const response = await this.caller.call(async () => {
|
|
782
|
+
const res = await this._fetch(`${this.apiUrl}/info`, {
|
|
783
|
+
method: "GET",
|
|
784
|
+
headers: { Accept: "application/json" },
|
|
785
|
+
signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT_MS),
|
|
786
|
+
...this.fetchOptions,
|
|
787
|
+
});
|
|
788
|
+
await raiseForStatus(res, "get server info");
|
|
789
|
+
return res;
|
|
595
790
|
});
|
|
596
|
-
|
|
597
|
-
|
|
791
|
+
const json = await response.json();
|
|
792
|
+
if (this.debug) {
|
|
793
|
+
console.log("\n=== LangSmith Server Configuration ===\n" +
|
|
794
|
+
JSON.stringify(json, null, 2) +
|
|
795
|
+
"\n");
|
|
796
|
+
}
|
|
797
|
+
return json;
|
|
598
798
|
}
|
|
599
799
|
async _ensureServerInfo() {
|
|
600
800
|
if (this._getServerInfoPromise === undefined) {
|
|
@@ -604,7 +804,7 @@ export class Client {
|
|
|
604
804
|
this._serverInfo = await this._getServerInfo();
|
|
605
805
|
}
|
|
606
806
|
catch (e) {
|
|
607
|
-
console.warn(`[
|
|
807
|
+
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}`);
|
|
608
808
|
}
|
|
609
809
|
}
|
|
610
810
|
return this._serverInfo ?? {};
|
|
@@ -628,16 +828,34 @@ export class Client {
|
|
|
628
828
|
*/
|
|
629
829
|
async flush() {
|
|
630
830
|
const sizeLimitBytes = await this._getBatchSizeLimitBytes();
|
|
631
|
-
await this.
|
|
831
|
+
const sizeLimit = await this._getBatchSizeLimit();
|
|
832
|
+
await this.drainAutoBatchQueue({
|
|
833
|
+
batchSizeLimitBytes: sizeLimitBytes,
|
|
834
|
+
batchSizeLimit: sizeLimit,
|
|
835
|
+
});
|
|
632
836
|
}
|
|
633
|
-
|
|
837
|
+
_cloneCurrentOTELContext() {
|
|
838
|
+
const otel_trace = getOTELTrace();
|
|
839
|
+
const otel_context = getOTELContext();
|
|
840
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
841
|
+
const currentSpan = otel_trace.getActiveSpan();
|
|
842
|
+
if (currentSpan) {
|
|
843
|
+
return otel_trace.setSpan(otel_context.active(), currentSpan);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
return undefined;
|
|
847
|
+
}
|
|
848
|
+
async createRun(run, options) {
|
|
634
849
|
if (!this._filterForSampling([run]).length) {
|
|
635
850
|
return;
|
|
636
851
|
}
|
|
637
|
-
const headers = {
|
|
852
|
+
const headers = {
|
|
853
|
+
...this.headers,
|
|
854
|
+
"Content-Type": "application/json",
|
|
855
|
+
};
|
|
638
856
|
const session_name = run.project_name;
|
|
639
857
|
delete run.project_name;
|
|
640
|
-
const runCreate = this.prepareRunCreateOrUpdateInputs({
|
|
858
|
+
const runCreate = await this.prepareRunCreateOrUpdateInputs({
|
|
641
859
|
session_name,
|
|
642
860
|
...run,
|
|
643
861
|
start_time: run.start_time ?? Date.now(),
|
|
@@ -645,32 +863,46 @@ export class Client {
|
|
|
645
863
|
if (this.autoBatchTracing &&
|
|
646
864
|
runCreate.trace_id !== undefined &&
|
|
647
865
|
runCreate.dotted_order !== undefined) {
|
|
866
|
+
const otelContext = this._cloneCurrentOTELContext();
|
|
648
867
|
void this.processRunOperation({
|
|
649
868
|
action: "create",
|
|
650
869
|
item: runCreate,
|
|
870
|
+
otelContext,
|
|
871
|
+
apiKey: options?.apiKey,
|
|
872
|
+
apiUrl: options?.apiUrl,
|
|
651
873
|
}).catch(console.error);
|
|
652
874
|
return;
|
|
653
875
|
}
|
|
654
|
-
const mergedRunCreateParam =
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
876
|
+
const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata);
|
|
877
|
+
if (options?.apiKey !== undefined) {
|
|
878
|
+
headers["x-api-key"] = options.apiKey;
|
|
879
|
+
}
|
|
880
|
+
if (options?.workspaceId !== undefined) {
|
|
881
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
882
|
+
}
|
|
883
|
+
const body = serializePayloadForTracing(mergedRunCreateParam, `Creating run with id: ${mergedRunCreateParam.id}`);
|
|
884
|
+
await this.caller.call(async () => {
|
|
885
|
+
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs`, {
|
|
886
|
+
method: "POST",
|
|
887
|
+
headers,
|
|
888
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
889
|
+
...this.fetchOptions,
|
|
890
|
+
body,
|
|
891
|
+
});
|
|
892
|
+
await raiseForStatus(res, "create run", true);
|
|
893
|
+
return res;
|
|
661
894
|
});
|
|
662
|
-
await raiseForStatus(response, "create run", true);
|
|
663
895
|
}
|
|
664
896
|
/**
|
|
665
897
|
* Batch ingest/upsert multiple runs in the Langsmith system.
|
|
666
898
|
* @param runs
|
|
667
899
|
*/
|
|
668
|
-
async batchIngestRuns({ runCreates, runUpdates, }) {
|
|
900
|
+
async batchIngestRuns({ runCreates, runUpdates, }, options) {
|
|
669
901
|
if (runCreates === undefined && runUpdates === undefined) {
|
|
670
902
|
return;
|
|
671
903
|
}
|
|
672
|
-
let preparedCreateParams = runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? [];
|
|
673
|
-
let preparedUpdateParams = runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? [];
|
|
904
|
+
let preparedCreateParams = await Promise.all(runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? []);
|
|
905
|
+
let preparedUpdateParams = await Promise.all(runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? []);
|
|
674
906
|
if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) {
|
|
675
907
|
const createById = preparedCreateParams.reduce((params, run) => {
|
|
676
908
|
if (!run.id) {
|
|
@@ -695,8 +927,8 @@ export class Client {
|
|
|
695
927
|
preparedUpdateParams = standaloneUpdates;
|
|
696
928
|
}
|
|
697
929
|
const rawBatch = {
|
|
698
|
-
post:
|
|
699
|
-
patch:
|
|
930
|
+
post: preparedCreateParams,
|
|
931
|
+
patch: preparedUpdateParams,
|
|
700
932
|
};
|
|
701
933
|
if (!rawBatch.post.length && !rawBatch.patch.length) {
|
|
702
934
|
return;
|
|
@@ -710,34 +942,45 @@ export class Client {
|
|
|
710
942
|
const batchItems = rawBatch[key].reverse();
|
|
711
943
|
let batchItem = batchItems.pop();
|
|
712
944
|
while (batchItem !== undefined) {
|
|
945
|
+
// Type is wrong but this is a deprecated code path anyway
|
|
713
946
|
batchChunks[key].push(batchItem);
|
|
714
947
|
batchItem = batchItems.pop();
|
|
715
948
|
}
|
|
716
949
|
}
|
|
717
950
|
if (batchChunks.post.length > 0 || batchChunks.patch.length > 0) {
|
|
718
|
-
|
|
951
|
+
const runIds = batchChunks.post
|
|
952
|
+
.map((item) => item.id)
|
|
953
|
+
.concat(batchChunks.patch.map((item) => item.id))
|
|
954
|
+
.join(",");
|
|
955
|
+
await this._postBatchIngestRuns(serializePayloadForTracing(batchChunks, `Ingesting runs with ids: ${runIds}`), options);
|
|
719
956
|
}
|
|
720
957
|
}
|
|
721
|
-
async _postBatchIngestRuns(body) {
|
|
958
|
+
async _postBatchIngestRuns(body, options) {
|
|
722
959
|
const headers = {
|
|
723
960
|
...this.headers,
|
|
724
961
|
"Content-Type": "application/json",
|
|
725
962
|
Accept: "application/json",
|
|
726
963
|
};
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
964
|
+
if (options?.apiKey !== undefined) {
|
|
965
|
+
headers["x-api-key"] = options.apiKey;
|
|
966
|
+
}
|
|
967
|
+
await this.batchIngestCaller.call(async () => {
|
|
968
|
+
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/batch`, {
|
|
969
|
+
method: "POST",
|
|
970
|
+
headers,
|
|
971
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
972
|
+
...this.fetchOptions,
|
|
973
|
+
body,
|
|
974
|
+
});
|
|
975
|
+
await raiseForStatus(res, "batch create run", true);
|
|
976
|
+
return res;
|
|
733
977
|
});
|
|
734
|
-
await raiseForStatus(response, "batch create run", true);
|
|
735
978
|
}
|
|
736
979
|
/**
|
|
737
980
|
* Batch ingest/upsert multiple runs in the Langsmith system.
|
|
738
981
|
* @param runs
|
|
739
982
|
*/
|
|
740
|
-
async multipartIngestRuns({ runCreates, runUpdates, }) {
|
|
983
|
+
async multipartIngestRuns({ runCreates, runUpdates, }, options) {
|
|
741
984
|
if (runCreates === undefined && runUpdates === undefined) {
|
|
742
985
|
return;
|
|
743
986
|
}
|
|
@@ -745,7 +988,7 @@ export class Client {
|
|
|
745
988
|
const allAttachments = {};
|
|
746
989
|
let preparedCreateParams = [];
|
|
747
990
|
for (const create of runCreates ?? []) {
|
|
748
|
-
const preparedCreate = this.prepareRunCreateOrUpdateInputs(create);
|
|
991
|
+
const preparedCreate = await this.prepareRunCreateOrUpdateInputs(create);
|
|
749
992
|
if (preparedCreate.id !== undefined &&
|
|
750
993
|
preparedCreate.attachments !== undefined) {
|
|
751
994
|
allAttachments[preparedCreate.id] = preparedCreate.attachments;
|
|
@@ -755,7 +998,7 @@ export class Client {
|
|
|
755
998
|
}
|
|
756
999
|
let preparedUpdateParams = [];
|
|
757
1000
|
for (const update of runUpdates ?? []) {
|
|
758
|
-
preparedUpdateParams.push(this.prepareRunCreateOrUpdateInputs(update));
|
|
1001
|
+
preparedUpdateParams.push(await this.prepareRunCreateOrUpdateInputs(update));
|
|
759
1002
|
}
|
|
760
1003
|
// require trace_id and dotted_order
|
|
761
1004
|
const invalidRunCreate = preparedCreateParams.find((runCreate) => {
|
|
@@ -807,10 +1050,10 @@ export class Client {
|
|
|
807
1050
|
]) {
|
|
808
1051
|
for (const originalPayload of payloads) {
|
|
809
1052
|
// collect fields to be sent as separate parts
|
|
810
|
-
const { inputs, outputs, events, attachments, ...payload } = originalPayload;
|
|
811
|
-
const fields = { inputs, outputs, events };
|
|
1053
|
+
const { inputs, outputs, events, extra, error, serialized, attachments, ...payload } = originalPayload;
|
|
1054
|
+
const fields = { inputs, outputs, events, extra, error, serialized };
|
|
812
1055
|
// encode the main run payload
|
|
813
|
-
const stringifiedPayload = serializePayloadForTracing(payload);
|
|
1056
|
+
const stringifiedPayload = serializePayloadForTracing(payload, `Serializing for multipart ingestion of run with id: ${payload.id}`);
|
|
814
1057
|
accumulatedParts.push({
|
|
815
1058
|
name: `${method}.${payload.id}`,
|
|
816
1059
|
payload: new Blob([stringifiedPayload], {
|
|
@@ -822,7 +1065,7 @@ export class Client {
|
|
|
822
1065
|
if (value === undefined) {
|
|
823
1066
|
continue;
|
|
824
1067
|
}
|
|
825
|
-
const stringifiedValue = serializePayloadForTracing(value);
|
|
1068
|
+
const stringifiedValue = serializePayloadForTracing(value, `Serializing ${key} for multipart ingestion of run with id: ${payload.id}`);
|
|
826
1069
|
accumulatedParts.push({
|
|
827
1070
|
name: `${method}.${payload.id}.${key}`,
|
|
828
1071
|
payload: new Blob([stringifiedValue], {
|
|
@@ -864,53 +1107,144 @@ export class Client {
|
|
|
864
1107
|
accumulatedContext.push(`trace=${payload.trace_id},id=${payload.id}`);
|
|
865
1108
|
}
|
|
866
1109
|
}
|
|
867
|
-
await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "));
|
|
868
|
-
}
|
|
869
|
-
async
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
1110
|
+
await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "), options);
|
|
1111
|
+
}
|
|
1112
|
+
async _createNodeFetchBody(parts, boundary) {
|
|
1113
|
+
// Create multipart form data manually using Blobs
|
|
1114
|
+
const chunks = [];
|
|
1115
|
+
for (const part of parts) {
|
|
1116
|
+
// Add field boundary
|
|
1117
|
+
chunks.push(new Blob([`--${boundary}\r\n`]));
|
|
1118
|
+
chunks.push(new Blob([
|
|
1119
|
+
`Content-Disposition: form-data; name="${part.name}"\r\n`,
|
|
1120
|
+
`Content-Type: ${part.payload.type}\r\n\r\n`,
|
|
1121
|
+
]));
|
|
1122
|
+
chunks.push(part.payload);
|
|
1123
|
+
chunks.push(new Blob(["\r\n"]));
|
|
1124
|
+
}
|
|
1125
|
+
// Add final boundary
|
|
1126
|
+
chunks.push(new Blob([`--${boundary}--\r\n`]));
|
|
1127
|
+
// Combine all chunks into a single Blob
|
|
1128
|
+
const body = new Blob(chunks);
|
|
1129
|
+
// Convert Blob to ArrayBuffer for compatibility
|
|
1130
|
+
const arrayBuffer = await body.arrayBuffer();
|
|
1131
|
+
return arrayBuffer;
|
|
1132
|
+
}
|
|
1133
|
+
async _createMultipartStream(parts, boundary) {
|
|
1134
|
+
const encoder = new TextEncoder();
|
|
1135
|
+
// Create a ReadableStream for streaming the multipart data
|
|
1136
|
+
// Only do special handling if we're using node-fetch
|
|
1137
|
+
const stream = new ReadableStream({
|
|
1138
|
+
async start(controller) {
|
|
1139
|
+
// Helper function to write a chunk to the stream
|
|
1140
|
+
const writeChunk = async (chunk) => {
|
|
1141
|
+
if (typeof chunk === "string") {
|
|
1142
|
+
controller.enqueue(encoder.encode(chunk));
|
|
1143
|
+
}
|
|
1144
|
+
else {
|
|
1145
|
+
controller.enqueue(chunk);
|
|
1146
|
+
}
|
|
1147
|
+
};
|
|
1148
|
+
// Write each part to the stream
|
|
1149
|
+
for (const part of parts) {
|
|
1150
|
+
// Write boundary and headers
|
|
1151
|
+
await writeChunk(`--${boundary}\r\n`);
|
|
1152
|
+
await writeChunk(`Content-Disposition: form-data; name="${part.name}"\r\n`);
|
|
1153
|
+
await writeChunk(`Content-Type: ${part.payload.type}\r\n\r\n`);
|
|
1154
|
+
// Write the payload
|
|
1155
|
+
const payloadStream = part.payload.stream();
|
|
1156
|
+
const reader = payloadStream.getReader();
|
|
1157
|
+
try {
|
|
1158
|
+
let result;
|
|
1159
|
+
while (!(result = await reader.read()).done) {
|
|
1160
|
+
controller.enqueue(result.value);
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
finally {
|
|
1164
|
+
reader.releaseLock();
|
|
1165
|
+
}
|
|
1166
|
+
await writeChunk("\r\n");
|
|
1167
|
+
}
|
|
1168
|
+
// Write final boundary
|
|
1169
|
+
await writeChunk(`--${boundary}--\r\n`);
|
|
1170
|
+
controller.close();
|
|
1171
|
+
},
|
|
1172
|
+
});
|
|
1173
|
+
return stream;
|
|
1174
|
+
}
|
|
1175
|
+
async _sendMultipartRequest(parts, context, options) {
|
|
1176
|
+
// Create multipart form data boundary
|
|
1177
|
+
const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2);
|
|
1178
|
+
const isNodeFetch = _globalFetchImplementationIsNodeFetch();
|
|
1179
|
+
const buildBuffered = () => this._createNodeFetchBody(parts, boundary);
|
|
1180
|
+
const buildStream = () => this._createMultipartStream(parts, boundary);
|
|
1181
|
+
const sendWithRetry = async (bodyFactory) => {
|
|
1182
|
+
return this.batchIngestCaller.call(async () => {
|
|
1183
|
+
const body = await bodyFactory();
|
|
1184
|
+
const headers = {
|
|
893
1185
|
...this.headers,
|
|
894
1186
|
"Content-Type": `multipart/form-data; boundary=${boundary}`,
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
1187
|
+
};
|
|
1188
|
+
if (options?.apiKey !== undefined) {
|
|
1189
|
+
headers["x-api-key"] = options.apiKey;
|
|
1190
|
+
}
|
|
1191
|
+
let transformedBody = body;
|
|
1192
|
+
if (options?.useGzip &&
|
|
1193
|
+
typeof body === "object" &&
|
|
1194
|
+
"pipeThrough" in body) {
|
|
1195
|
+
transformedBody = body.pipeThrough(new CompressionStream("gzip"));
|
|
1196
|
+
headers["Content-Encoding"] = "gzip";
|
|
1197
|
+
}
|
|
1198
|
+
const response = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/multipart`, {
|
|
1199
|
+
method: "POST",
|
|
1200
|
+
headers,
|
|
1201
|
+
body: transformedBody,
|
|
1202
|
+
duplex: "half",
|
|
1203
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1204
|
+
...this.fetchOptions,
|
|
1205
|
+
});
|
|
1206
|
+
await raiseForStatus(response, `Failed to send multipart request`, true);
|
|
1207
|
+
return response;
|
|
899
1208
|
});
|
|
900
|
-
|
|
1209
|
+
};
|
|
1210
|
+
try {
|
|
1211
|
+
let res;
|
|
1212
|
+
let streamedAttempt = false;
|
|
1213
|
+
// attempt stream only if not disabled and not using node-fetch or Bun
|
|
1214
|
+
if (!isNodeFetch &&
|
|
1215
|
+
!this.multipartStreamingDisabled &&
|
|
1216
|
+
getEnv() !== "bun") {
|
|
1217
|
+
streamedAttempt = true;
|
|
1218
|
+
res = await sendWithRetry(buildStream);
|
|
1219
|
+
}
|
|
1220
|
+
else {
|
|
1221
|
+
res = await sendWithRetry(buildBuffered);
|
|
1222
|
+
}
|
|
1223
|
+
// if stream fails, fallback to buffered body
|
|
1224
|
+
if ((!this.multipartStreamingDisabled || streamedAttempt) &&
|
|
1225
|
+
res.status === 422 &&
|
|
1226
|
+
(options?.apiUrl ?? this.apiUrl) !== DEFAULT_API_URL) {
|
|
1227
|
+
console.warn(`Streaming multipart upload to ${options?.apiUrl ?? this.apiUrl}/runs/multipart failed. ` +
|
|
1228
|
+
`This usually means the host does not support chunked uploads. ` +
|
|
1229
|
+
`Retrying with a buffered upload for operation "${context}".`);
|
|
1230
|
+
// Disable streaming for future requests
|
|
1231
|
+
this.multipartStreamingDisabled = true;
|
|
1232
|
+
// retry with fully-buffered body
|
|
1233
|
+
res = await sendWithRetry(buildBuffered);
|
|
1234
|
+
}
|
|
901
1235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
902
1236
|
}
|
|
903
1237
|
catch (e) {
|
|
904
1238
|
console.warn(`${e.message.trim()}\n\nContext: ${context}`);
|
|
905
1239
|
}
|
|
906
1240
|
}
|
|
907
|
-
async updateRun(runId, run) {
|
|
1241
|
+
async updateRun(runId, run, options) {
|
|
908
1242
|
assertUuid(runId);
|
|
909
1243
|
if (run.inputs) {
|
|
910
|
-
run.inputs = this.processInputs(run.inputs);
|
|
1244
|
+
run.inputs = await this.processInputs(run.inputs);
|
|
911
1245
|
}
|
|
912
1246
|
if (run.outputs) {
|
|
913
|
-
run.outputs = this.processOutputs(run.outputs);
|
|
1247
|
+
run.outputs = await this.processOutputs(run.outputs);
|
|
914
1248
|
}
|
|
915
1249
|
// TODO: Untangle types
|
|
916
1250
|
const data = { ...run, id: runId };
|
|
@@ -920,34 +1254,60 @@ export class Client {
|
|
|
920
1254
|
if (this.autoBatchTracing &&
|
|
921
1255
|
data.trace_id !== undefined &&
|
|
922
1256
|
data.dotted_order !== undefined) {
|
|
1257
|
+
const otelContext = this._cloneCurrentOTELContext();
|
|
923
1258
|
if (run.end_time !== undefined &&
|
|
924
1259
|
data.parent_run_id === undefined &&
|
|
925
1260
|
this.blockOnRootRunFinalization &&
|
|
926
1261
|
!this.manualFlushMode) {
|
|
927
1262
|
// Trigger batches as soon as a root trace ends and wait to ensure trace finishes
|
|
928
1263
|
// in serverless environments.
|
|
929
|
-
await this.processRunOperation({
|
|
1264
|
+
await this.processRunOperation({
|
|
1265
|
+
action: "update",
|
|
1266
|
+
item: data,
|
|
1267
|
+
otelContext,
|
|
1268
|
+
apiKey: options?.apiKey,
|
|
1269
|
+
apiUrl: options?.apiUrl,
|
|
1270
|
+
}).catch(console.error);
|
|
930
1271
|
return;
|
|
931
1272
|
}
|
|
932
1273
|
else {
|
|
933
|
-
void this.processRunOperation({
|
|
1274
|
+
void this.processRunOperation({
|
|
1275
|
+
action: "update",
|
|
1276
|
+
item: data,
|
|
1277
|
+
otelContext,
|
|
1278
|
+
apiKey: options?.apiKey,
|
|
1279
|
+
apiUrl: options?.apiUrl,
|
|
1280
|
+
}).catch(console.error);
|
|
934
1281
|
}
|
|
935
1282
|
return;
|
|
936
1283
|
}
|
|
937
|
-
const headers = {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
1284
|
+
const headers = {
|
|
1285
|
+
...this.headers,
|
|
1286
|
+
"Content-Type": "application/json",
|
|
1287
|
+
};
|
|
1288
|
+
if (options?.apiKey !== undefined) {
|
|
1289
|
+
headers["x-api-key"] = options.apiKey;
|
|
1290
|
+
}
|
|
1291
|
+
if (options?.workspaceId !== undefined) {
|
|
1292
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
1293
|
+
}
|
|
1294
|
+
const body = serializePayloadForTracing(run, `Serializing payload to update run with id: ${runId}`);
|
|
1295
|
+
await this.caller.call(async () => {
|
|
1296
|
+
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/${runId}`, {
|
|
1297
|
+
method: "PATCH",
|
|
1298
|
+
headers,
|
|
1299
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1300
|
+
...this.fetchOptions,
|
|
1301
|
+
body,
|
|
1302
|
+
});
|
|
1303
|
+
await raiseForStatus(res, "update run", true);
|
|
1304
|
+
return res;
|
|
944
1305
|
});
|
|
945
|
-
await raiseForStatus(response, "update run", true);
|
|
946
1306
|
}
|
|
947
1307
|
async readRun(runId, { loadChildRuns } = { loadChildRuns: false }) {
|
|
948
1308
|
assertUuid(runId);
|
|
949
1309
|
let run = await this._get(`/runs/${runId}`);
|
|
950
|
-
if (loadChildRuns
|
|
1310
|
+
if (loadChildRuns) {
|
|
951
1311
|
run = await this._loadChildRuns(run);
|
|
952
1312
|
}
|
|
953
1313
|
return run;
|
|
@@ -986,7 +1346,11 @@ export class Client {
|
|
|
986
1346
|
}
|
|
987
1347
|
}
|
|
988
1348
|
async _loadChildRuns(run) {
|
|
989
|
-
const childRuns = await toArray(this.listRuns({
|
|
1349
|
+
const childRuns = await toArray(this.listRuns({
|
|
1350
|
+
isRoot: false,
|
|
1351
|
+
projectId: run.session_id,
|
|
1352
|
+
traceId: run.trace_id,
|
|
1353
|
+
}));
|
|
990
1354
|
const treemap = {};
|
|
991
1355
|
const runs = {};
|
|
992
1356
|
// TODO: make dotted order required when the migration finishes
|
|
@@ -996,11 +1360,14 @@ export class Client {
|
|
|
996
1360
|
childRun.parent_run_id === undefined) {
|
|
997
1361
|
throw new Error(`Child run ${childRun.id} has no parent`);
|
|
998
1362
|
}
|
|
999
|
-
if (
|
|
1000
|
-
|
|
1363
|
+
if (childRun.dotted_order?.startsWith(run.dotted_order ?? "") &&
|
|
1364
|
+
childRun.id !== run.id) {
|
|
1365
|
+
if (!(childRun.parent_run_id in treemap)) {
|
|
1366
|
+
treemap[childRun.parent_run_id] = [];
|
|
1367
|
+
}
|
|
1368
|
+
treemap[childRun.parent_run_id].push(childRun);
|
|
1369
|
+
runs[childRun.id] = childRun;
|
|
1001
1370
|
}
|
|
1002
|
-
treemap[childRun.parent_run_id].push(childRun);
|
|
1003
|
-
runs[childRun.id] = childRun;
|
|
1004
1371
|
}
|
|
1005
1372
|
run.child_runs = treemap[run.id] || [];
|
|
1006
1373
|
for (const runId in treemap) {
|
|
@@ -1093,7 +1460,7 @@ export class Client {
|
|
|
1093
1460
|
* });
|
|
1094
1461
|
*/
|
|
1095
1462
|
async *listRuns(props) {
|
|
1096
|
-
const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, } = props;
|
|
1463
|
+
const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, order, } = props;
|
|
1097
1464
|
let projectIds = [];
|
|
1098
1465
|
if (projectId) {
|
|
1099
1466
|
projectIds = Array.isArray(projectId) ? projectId : [projectId];
|
|
@@ -1107,7 +1474,6 @@ export class Client {
|
|
|
1107
1474
|
}
|
|
1108
1475
|
const default_select = [
|
|
1109
1476
|
"app_path",
|
|
1110
|
-
"child_run_ids",
|
|
1111
1477
|
"completion_cost",
|
|
1112
1478
|
"completion_tokens",
|
|
1113
1479
|
"dotted_order",
|
|
@@ -1152,7 +1518,11 @@ export class Client {
|
|
|
1152
1518
|
trace: traceId,
|
|
1153
1519
|
select: select ? select : default_select,
|
|
1154
1520
|
is_root: isRoot,
|
|
1521
|
+
order,
|
|
1155
1522
|
};
|
|
1523
|
+
if (body.select.includes("child_run_ids")) {
|
|
1524
|
+
warnOnce("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");
|
|
1525
|
+
}
|
|
1156
1526
|
let runsYielded = 0;
|
|
1157
1527
|
for await (const runs of this._getCursorPaginatedList("/runs/query", body)) {
|
|
1158
1528
|
if (limit) {
|
|
@@ -1172,6 +1542,53 @@ export class Client {
|
|
|
1172
1542
|
}
|
|
1173
1543
|
}
|
|
1174
1544
|
}
|
|
1545
|
+
async *listGroupRuns(props) {
|
|
1546
|
+
const { projectId, projectName, groupBy, filter, startTime, endTime, limit, offset, } = props;
|
|
1547
|
+
const sessionId = projectId || (await this.readProject({ projectName })).id;
|
|
1548
|
+
const baseBody = {
|
|
1549
|
+
session_id: sessionId,
|
|
1550
|
+
group_by: groupBy,
|
|
1551
|
+
filter,
|
|
1552
|
+
start_time: startTime ? startTime.toISOString() : null,
|
|
1553
|
+
end_time: endTime ? endTime.toISOString() : null,
|
|
1554
|
+
limit: Number(limit) || 100,
|
|
1555
|
+
};
|
|
1556
|
+
let currentOffset = Number(offset) || 0;
|
|
1557
|
+
const path = "/runs/group";
|
|
1558
|
+
const url = `${this.apiUrl}${path}`;
|
|
1559
|
+
while (true) {
|
|
1560
|
+
const currentBody = {
|
|
1561
|
+
...baseBody,
|
|
1562
|
+
offset: currentOffset,
|
|
1563
|
+
};
|
|
1564
|
+
// Remove undefined values from the payload
|
|
1565
|
+
const filteredPayload = Object.fromEntries(Object.entries(currentBody).filter(([_, value]) => value !== undefined));
|
|
1566
|
+
const body = JSON.stringify(filteredPayload);
|
|
1567
|
+
const response = await this.caller.call(async () => {
|
|
1568
|
+
const res = await this._fetch(url, {
|
|
1569
|
+
method: "POST",
|
|
1570
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1571
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1572
|
+
...this.fetchOptions,
|
|
1573
|
+
body,
|
|
1574
|
+
});
|
|
1575
|
+
await raiseForStatus(res, `Failed to fetch ${path}`);
|
|
1576
|
+
return res;
|
|
1577
|
+
});
|
|
1578
|
+
const items = await response.json();
|
|
1579
|
+
const { groups, total } = items;
|
|
1580
|
+
if (groups.length === 0) {
|
|
1581
|
+
break;
|
|
1582
|
+
}
|
|
1583
|
+
for (const thread of groups) {
|
|
1584
|
+
yield thread;
|
|
1585
|
+
}
|
|
1586
|
+
currentOffset += groups.length;
|
|
1587
|
+
if (currentOffset >= total) {
|
|
1588
|
+
break;
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1175
1592
|
async getRunStats({ id, trace, parentRun, runType, projectNames, projectIds, referenceExampleIds, startTime, endTime, error, query, filter, traceFilter, treeFilter, isRoot, dataSourceType, }) {
|
|
1176
1593
|
let projectIds_ = projectIds || [];
|
|
1177
1594
|
if (projectNames) {
|
|
@@ -1199,12 +1616,17 @@ export class Client {
|
|
|
1199
1616
|
};
|
|
1200
1617
|
// Remove undefined values from the payload
|
|
1201
1618
|
const filteredPayload = Object.fromEntries(Object.entries(payload).filter(([_, value]) => value !== undefined));
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1619
|
+
const body = JSON.stringify(filteredPayload);
|
|
1620
|
+
const response = await this.caller.call(async () => {
|
|
1621
|
+
const res = await this._fetch(`${this.apiUrl}/runs/stats`, {
|
|
1622
|
+
method: "POST",
|
|
1623
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1624
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1625
|
+
...this.fetchOptions,
|
|
1626
|
+
body,
|
|
1627
|
+
});
|
|
1628
|
+
await raiseForStatus(res, "get run stats");
|
|
1629
|
+
return res;
|
|
1208
1630
|
});
|
|
1209
1631
|
const result = await response.json();
|
|
1210
1632
|
return result;
|
|
@@ -1215,12 +1637,17 @@ export class Client {
|
|
|
1215
1637
|
share_token: shareId || uuid.v4(),
|
|
1216
1638
|
};
|
|
1217
1639
|
assertUuid(runId);
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1640
|
+
const body = JSON.stringify(data);
|
|
1641
|
+
const response = await this.caller.call(async () => {
|
|
1642
|
+
const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
|
|
1643
|
+
method: "PUT",
|
|
1644
|
+
headers: this.headers,
|
|
1645
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1646
|
+
...this.fetchOptions,
|
|
1647
|
+
body,
|
|
1648
|
+
});
|
|
1649
|
+
await raiseForStatus(res, "share run");
|
|
1650
|
+
return res;
|
|
1224
1651
|
});
|
|
1225
1652
|
const result = await response.json();
|
|
1226
1653
|
if (result === null || !("share_token" in result)) {
|
|
@@ -1230,21 +1657,28 @@ export class Client {
|
|
|
1230
1657
|
}
|
|
1231
1658
|
async unshareRun(runId) {
|
|
1232
1659
|
assertUuid(runId);
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1660
|
+
await this.caller.call(async () => {
|
|
1661
|
+
const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
|
|
1662
|
+
method: "DELETE",
|
|
1663
|
+
headers: this.headers,
|
|
1664
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1665
|
+
...this.fetchOptions,
|
|
1666
|
+
});
|
|
1667
|
+
await raiseForStatus(res, "unshare run", true);
|
|
1668
|
+
return res;
|
|
1238
1669
|
});
|
|
1239
|
-
await raiseForStatus(response, "unshare run", true);
|
|
1240
1670
|
}
|
|
1241
1671
|
async readRunSharedLink(runId) {
|
|
1242
1672
|
assertUuid(runId);
|
|
1243
|
-
const response = await this.caller.call(
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1673
|
+
const response = await this.caller.call(async () => {
|
|
1674
|
+
const res = await this._fetch(`${this.apiUrl}/runs/${runId}/share`, {
|
|
1675
|
+
method: "GET",
|
|
1676
|
+
headers: this.headers,
|
|
1677
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1678
|
+
...this.fetchOptions,
|
|
1679
|
+
});
|
|
1680
|
+
await raiseForStatus(res, "read run shared link");
|
|
1681
|
+
return res;
|
|
1248
1682
|
});
|
|
1249
1683
|
const result = await response.json();
|
|
1250
1684
|
if (result === null || !("share_token" in result)) {
|
|
@@ -1262,11 +1696,15 @@ export class Client {
|
|
|
1262
1696
|
}
|
|
1263
1697
|
}
|
|
1264
1698
|
assertUuid(shareToken);
|
|
1265
|
-
const response = await this.caller.call(
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1699
|
+
const response = await this.caller.call(async () => {
|
|
1700
|
+
const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/runs${queryParams}`, {
|
|
1701
|
+
method: "GET",
|
|
1702
|
+
headers: this.headers,
|
|
1703
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1704
|
+
...this.fetchOptions,
|
|
1705
|
+
});
|
|
1706
|
+
await raiseForStatus(res, "list shared runs");
|
|
1707
|
+
return res;
|
|
1270
1708
|
});
|
|
1271
1709
|
const runs = await response.json();
|
|
1272
1710
|
return runs;
|
|
@@ -1280,11 +1718,15 @@ export class Client {
|
|
|
1280
1718
|
datasetId = dataset.id;
|
|
1281
1719
|
}
|
|
1282
1720
|
assertUuid(datasetId);
|
|
1283
|
-
const response = await this.caller.call(
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1721
|
+
const response = await this.caller.call(async () => {
|
|
1722
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1723
|
+
method: "GET",
|
|
1724
|
+
headers: this.headers,
|
|
1725
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1726
|
+
...this.fetchOptions,
|
|
1727
|
+
});
|
|
1728
|
+
await raiseForStatus(res, "read dataset shared schema");
|
|
1729
|
+
return res;
|
|
1288
1730
|
});
|
|
1289
1731
|
const shareSchema = await response.json();
|
|
1290
1732
|
shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
|
|
@@ -1302,12 +1744,17 @@ export class Client {
|
|
|
1302
1744
|
dataset_id: datasetId,
|
|
1303
1745
|
};
|
|
1304
1746
|
assertUuid(datasetId);
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1747
|
+
const body = JSON.stringify(data);
|
|
1748
|
+
const response = await this.caller.call(async () => {
|
|
1749
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1750
|
+
method: "PUT",
|
|
1751
|
+
headers: this.headers,
|
|
1752
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1753
|
+
...this.fetchOptions,
|
|
1754
|
+
body,
|
|
1755
|
+
});
|
|
1756
|
+
await raiseForStatus(res, "share dataset");
|
|
1757
|
+
return res;
|
|
1311
1758
|
});
|
|
1312
1759
|
const shareSchema = await response.json();
|
|
1313
1760
|
shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
|
|
@@ -1315,21 +1762,28 @@ export class Client {
|
|
|
1315
1762
|
}
|
|
1316
1763
|
async unshareDataset(datasetId) {
|
|
1317
1764
|
assertUuid(datasetId);
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1765
|
+
await this.caller.call(async () => {
|
|
1766
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1767
|
+
method: "DELETE",
|
|
1768
|
+
headers: this.headers,
|
|
1769
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1770
|
+
...this.fetchOptions,
|
|
1771
|
+
});
|
|
1772
|
+
await raiseForStatus(res, "unshare dataset", true);
|
|
1773
|
+
return res;
|
|
1323
1774
|
});
|
|
1324
|
-
await raiseForStatus(response, "unshare dataset", true);
|
|
1325
1775
|
}
|
|
1326
1776
|
async readSharedDataset(shareToken) {
|
|
1327
1777
|
assertUuid(shareToken);
|
|
1328
|
-
const response = await this.caller.call(
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1778
|
+
const response = await this.caller.call(async () => {
|
|
1779
|
+
const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/datasets`, {
|
|
1780
|
+
method: "GET",
|
|
1781
|
+
headers: this.headers,
|
|
1782
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1783
|
+
...this.fetchOptions,
|
|
1784
|
+
});
|
|
1785
|
+
await raiseForStatus(res, "read shared dataset");
|
|
1786
|
+
return res;
|
|
1333
1787
|
});
|
|
1334
1788
|
const dataset = await response.json();
|
|
1335
1789
|
return dataset;
|
|
@@ -1356,16 +1810,22 @@ export class Client {
|
|
|
1356
1810
|
urlParams.append(key, value);
|
|
1357
1811
|
}
|
|
1358
1812
|
});
|
|
1359
|
-
const response = await this.caller.call(
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1813
|
+
const response = await this.caller.call(async () => {
|
|
1814
|
+
const res = await this._fetch(`${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, {
|
|
1815
|
+
method: "GET",
|
|
1816
|
+
headers: this.headers,
|
|
1817
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1818
|
+
...this.fetchOptions,
|
|
1819
|
+
});
|
|
1820
|
+
await raiseForStatus(res, "list shared examples");
|
|
1821
|
+
return res;
|
|
1364
1822
|
});
|
|
1365
1823
|
const result = await response.json();
|
|
1366
1824
|
if (!response.ok) {
|
|
1367
1825
|
if ("detail" in result) {
|
|
1368
|
-
throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${result.detail
|
|
1826
|
+
throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${Array.isArray(result.detail)
|
|
1827
|
+
? result.detail.join("\n")
|
|
1828
|
+
: "Unspecified error"}`);
|
|
1369
1829
|
}
|
|
1370
1830
|
throw new Error(`Failed to list shared examples: ${response.status} ${response.statusText}`);
|
|
1371
1831
|
}
|
|
@@ -1389,14 +1849,18 @@ export class Client {
|
|
|
1389
1849
|
if (referenceDatasetId !== null) {
|
|
1390
1850
|
body["reference_dataset_id"] = referenceDatasetId;
|
|
1391
1851
|
}
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1852
|
+
const serializedBody = JSON.stringify(body);
|
|
1853
|
+
const response = await this.caller.call(async () => {
|
|
1854
|
+
const res = await this._fetch(endpoint, {
|
|
1855
|
+
method: "POST",
|
|
1856
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1857
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1858
|
+
...this.fetchOptions,
|
|
1859
|
+
body: serializedBody,
|
|
1860
|
+
});
|
|
1861
|
+
await raiseForStatus(res, "create project");
|
|
1862
|
+
return res;
|
|
1398
1863
|
});
|
|
1399
|
-
await raiseForStatus(response, "create project");
|
|
1400
1864
|
const result = await response.json();
|
|
1401
1865
|
return result;
|
|
1402
1866
|
}
|
|
@@ -1406,20 +1870,23 @@ export class Client {
|
|
|
1406
1870
|
if (metadata) {
|
|
1407
1871
|
extra = { ...(extra || {}), metadata };
|
|
1408
1872
|
}
|
|
1409
|
-
const body = {
|
|
1873
|
+
const body = JSON.stringify({
|
|
1410
1874
|
name,
|
|
1411
1875
|
extra,
|
|
1412
1876
|
description,
|
|
1413
1877
|
end_time: endTime ? new Date(endTime).toISOString() : null,
|
|
1414
|
-
};
|
|
1415
|
-
const response = await this.caller.call(
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1878
|
+
});
|
|
1879
|
+
const response = await this.caller.call(async () => {
|
|
1880
|
+
const res = await this._fetch(endpoint, {
|
|
1881
|
+
method: "PATCH",
|
|
1882
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1883
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1884
|
+
...this.fetchOptions,
|
|
1885
|
+
body,
|
|
1886
|
+
});
|
|
1887
|
+
await raiseForStatus(res, "update project");
|
|
1888
|
+
return res;
|
|
1889
|
+
});
|
|
1423
1890
|
const result = await response.json();
|
|
1424
1891
|
return result;
|
|
1425
1892
|
}
|
|
@@ -1440,11 +1907,15 @@ export class Client {
|
|
|
1440
1907
|
else {
|
|
1441
1908
|
throw new Error("Must provide projectName or projectId");
|
|
1442
1909
|
}
|
|
1443
|
-
const response = await this.caller.call(
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1910
|
+
const response = await this.caller.call(async () => {
|
|
1911
|
+
const res = await this._fetch(`${this.apiUrl}${path}?${params}`, {
|
|
1912
|
+
method: "GET",
|
|
1913
|
+
headers: this.headers,
|
|
1914
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1915
|
+
...this.fetchOptions,
|
|
1916
|
+
});
|
|
1917
|
+
await raiseForStatus(res, "has project");
|
|
1918
|
+
return res;
|
|
1448
1919
|
});
|
|
1449
1920
|
// consume the response body to release the connection
|
|
1450
1921
|
// https://undici.nodejs.org/#/?id=garbage-collection
|
|
@@ -1523,7 +1994,7 @@ export class Client {
|
|
|
1523
1994
|
}
|
|
1524
1995
|
throw new Error("No projects found to resolve tenant.");
|
|
1525
1996
|
}
|
|
1526
|
-
async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, referenceFree, metadata, } = {}) {
|
|
1997
|
+
async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, includeStats, datasetVersion, referenceFree, metadata, } = {}) {
|
|
1527
1998
|
const params = new URLSearchParams();
|
|
1528
1999
|
if (projectIds !== undefined) {
|
|
1529
2000
|
for (const projectId of projectIds) {
|
|
@@ -1545,6 +2016,12 @@ export class Client {
|
|
|
1545
2016
|
});
|
|
1546
2017
|
params.append("reference_dataset", dataset.id);
|
|
1547
2018
|
}
|
|
2019
|
+
if (includeStats !== undefined) {
|
|
2020
|
+
params.append("include_stats", includeStats.toString());
|
|
2021
|
+
}
|
|
2022
|
+
if (datasetVersion !== undefined) {
|
|
2023
|
+
params.append("dataset_version", datasetVersion);
|
|
2024
|
+
}
|
|
1548
2025
|
if (referenceFree !== undefined) {
|
|
1549
2026
|
params.append("reference_free", referenceFree.toString());
|
|
1550
2027
|
}
|
|
@@ -1570,13 +2047,16 @@ export class Client {
|
|
|
1570
2047
|
projectId_ = projectId;
|
|
1571
2048
|
}
|
|
1572
2049
|
assertUuid(projectId_);
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
2050
|
+
await this.caller.call(async () => {
|
|
2051
|
+
const res = await this._fetch(`${this.apiUrl}/sessions/${projectId_}`, {
|
|
2052
|
+
method: "DELETE",
|
|
2053
|
+
headers: this.headers,
|
|
2054
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2055
|
+
...this.fetchOptions,
|
|
2056
|
+
});
|
|
2057
|
+
await raiseForStatus(res, `delete session ${projectId_} (${projectName})`, true);
|
|
2058
|
+
return res;
|
|
1578
2059
|
});
|
|
1579
|
-
await raiseForStatus(response, `delete session ${projectId_} (${projectName})`, true);
|
|
1580
2060
|
}
|
|
1581
2061
|
async uploadCsv({ csvFile, fileName, inputKeys, outputKeys, description, dataType, name, }) {
|
|
1582
2062
|
const url = `${this.apiUrl}/datasets/upload`;
|
|
@@ -1597,14 +2077,17 @@ export class Client {
|
|
|
1597
2077
|
if (name) {
|
|
1598
2078
|
formData.append("name", name);
|
|
1599
2079
|
}
|
|
1600
|
-
const response = await this.caller.call(
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
2080
|
+
const response = await this.caller.call(async () => {
|
|
2081
|
+
const res = await this._fetch(url, {
|
|
2082
|
+
method: "POST",
|
|
2083
|
+
headers: this.headers,
|
|
2084
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2085
|
+
...this.fetchOptions,
|
|
2086
|
+
body: formData,
|
|
2087
|
+
});
|
|
2088
|
+
await raiseForStatus(res, "upload CSV");
|
|
2089
|
+
return res;
|
|
1606
2090
|
});
|
|
1607
|
-
await raiseForStatus(response, "upload CSV");
|
|
1608
2091
|
const result = await response.json();
|
|
1609
2092
|
return result;
|
|
1610
2093
|
}
|
|
@@ -1623,14 +2106,18 @@ export class Client {
|
|
|
1623
2106
|
if (outputsSchema) {
|
|
1624
2107
|
body.outputs_schema_definition = outputsSchema;
|
|
1625
2108
|
}
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
2109
|
+
const serializedBody = JSON.stringify(body);
|
|
2110
|
+
const response = await this.caller.call(async () => {
|
|
2111
|
+
const res = await this._fetch(`${this.apiUrl}/datasets`, {
|
|
2112
|
+
method: "POST",
|
|
2113
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2114
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2115
|
+
...this.fetchOptions,
|
|
2116
|
+
body: serializedBody,
|
|
2117
|
+
});
|
|
2118
|
+
await raiseForStatus(res, "create dataset");
|
|
2119
|
+
return res;
|
|
1632
2120
|
});
|
|
1633
|
-
await raiseForStatus(response, "create dataset");
|
|
1634
2121
|
const result = await response.json();
|
|
1635
2122
|
return result;
|
|
1636
2123
|
}
|
|
@@ -1638,14 +2125,14 @@ export class Client {
|
|
|
1638
2125
|
let path = "/datasets";
|
|
1639
2126
|
// limit to 1 result
|
|
1640
2127
|
const params = new URLSearchParams({ limit: "1" });
|
|
1641
|
-
if (datasetId
|
|
2128
|
+
if (datasetId && datasetName) {
|
|
1642
2129
|
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1643
2130
|
}
|
|
1644
|
-
else if (datasetId
|
|
2131
|
+
else if (datasetId) {
|
|
1645
2132
|
assertUuid(datasetId);
|
|
1646
2133
|
path += `/${datasetId}`;
|
|
1647
2134
|
}
|
|
1648
|
-
else if (datasetName
|
|
2135
|
+
else if (datasetName) {
|
|
1649
2136
|
params.append("name", datasetName);
|
|
1650
2137
|
}
|
|
1651
2138
|
else {
|
|
@@ -1755,14 +2242,18 @@ export class Client {
|
|
|
1755
2242
|
}
|
|
1756
2243
|
const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
|
|
1757
2244
|
assertUuid(_datasetId);
|
|
1758
|
-
const
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
2245
|
+
const body = JSON.stringify(update);
|
|
2246
|
+
const response = await this.caller.call(async () => {
|
|
2247
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}`, {
|
|
2248
|
+
method: "PATCH",
|
|
2249
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2250
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2251
|
+
...this.fetchOptions,
|
|
2252
|
+
body,
|
|
2253
|
+
});
|
|
2254
|
+
await raiseForStatus(res, "update dataset");
|
|
2255
|
+
return res;
|
|
2256
|
+
});
|
|
1766
2257
|
return (await response.json());
|
|
1767
2258
|
}
|
|
1768
2259
|
/**
|
|
@@ -1787,17 +2278,21 @@ export class Client {
|
|
|
1787
2278
|
}
|
|
1788
2279
|
const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
|
|
1789
2280
|
assertUuid(_datasetId);
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
2281
|
+
const body = JSON.stringify({
|
|
2282
|
+
as_of: typeof asOf === "string" ? asOf : asOf.toISOString(),
|
|
2283
|
+
tag,
|
|
2284
|
+
});
|
|
2285
|
+
await this.caller.call(async () => {
|
|
2286
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${_datasetId}/tags`, {
|
|
2287
|
+
method: "PUT",
|
|
2288
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2289
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2290
|
+
...this.fetchOptions,
|
|
2291
|
+
body,
|
|
2292
|
+
});
|
|
2293
|
+
await raiseForStatus(res, "update dataset tags", true);
|
|
2294
|
+
return res;
|
|
1799
2295
|
});
|
|
1800
|
-
await raiseForStatus(response, "update dataset tags");
|
|
1801
2296
|
}
|
|
1802
2297
|
async deleteDataset({ datasetId, datasetName, }) {
|
|
1803
2298
|
let path = "/datasets";
|
|
@@ -1816,14 +2311,16 @@ export class Client {
|
|
|
1816
2311
|
else {
|
|
1817
2312
|
throw new Error("Must provide datasetName or datasetId");
|
|
1818
2313
|
}
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
2314
|
+
await this.caller.call(async () => {
|
|
2315
|
+
const res = await this._fetch(this.apiUrl + path, {
|
|
2316
|
+
method: "DELETE",
|
|
2317
|
+
headers: this.headers,
|
|
2318
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2319
|
+
...this.fetchOptions,
|
|
2320
|
+
});
|
|
2321
|
+
await raiseForStatus(res, `delete ${path}`, true);
|
|
2322
|
+
return res;
|
|
1824
2323
|
});
|
|
1825
|
-
await raiseForStatus(response, `delete ${path}`);
|
|
1826
|
-
await response.json();
|
|
1827
2324
|
}
|
|
1828
2325
|
async indexDataset({ datasetId, datasetName, tag, }) {
|
|
1829
2326
|
let datasetId_ = datasetId;
|
|
@@ -1841,14 +2338,18 @@ export class Client {
|
|
|
1841
2338
|
const data = {
|
|
1842
2339
|
tag: tag,
|
|
1843
2340
|
};
|
|
1844
|
-
const
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
2341
|
+
const body = JSON.stringify(data);
|
|
2342
|
+
const response = await this.caller.call(async () => {
|
|
2343
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/index`, {
|
|
2344
|
+
method: "POST",
|
|
2345
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2346
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2347
|
+
...this.fetchOptions,
|
|
2348
|
+
body,
|
|
2349
|
+
});
|
|
2350
|
+
await raiseForStatus(res, "index dataset");
|
|
2351
|
+
return res;
|
|
2352
|
+
});
|
|
1852
2353
|
await response.json();
|
|
1853
2354
|
}
|
|
1854
2355
|
/**
|
|
@@ -1890,14 +2391,18 @@ export class Client {
|
|
|
1890
2391
|
data["filter"] = filter;
|
|
1891
2392
|
}
|
|
1892
2393
|
assertUuid(datasetId);
|
|
1893
|
-
const
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
2394
|
+
const body = JSON.stringify(data);
|
|
2395
|
+
const response = await this.caller.call(async () => {
|
|
2396
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId}/search`, {
|
|
2397
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2398
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2399
|
+
...this.fetchOptions,
|
|
2400
|
+
method: "POST",
|
|
2401
|
+
body,
|
|
2402
|
+
});
|
|
2403
|
+
await raiseForStatus(res, "fetch similar examples");
|
|
2404
|
+
return res;
|
|
2405
|
+
});
|
|
1901
2406
|
const result = await response.json();
|
|
1902
2407
|
return result["examples"];
|
|
1903
2408
|
}
|
|
@@ -2109,14 +2614,16 @@ export class Client {
|
|
|
2109
2614
|
async deleteExample(exampleId) {
|
|
2110
2615
|
assertUuid(exampleId);
|
|
2111
2616
|
const path = `/examples/${exampleId}`;
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2617
|
+
await this.caller.call(async () => {
|
|
2618
|
+
const res = await this._fetch(this.apiUrl + path, {
|
|
2619
|
+
method: "DELETE",
|
|
2620
|
+
headers: this.headers,
|
|
2621
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2622
|
+
...this.fetchOptions,
|
|
2623
|
+
});
|
|
2624
|
+
await raiseForStatus(res, `delete ${path}`, true);
|
|
2625
|
+
return res;
|
|
2117
2626
|
});
|
|
2118
|
-
await raiseForStatus(response, `delete ${path}`);
|
|
2119
|
-
await response.json();
|
|
2120
2627
|
}
|
|
2121
2628
|
async updateExample(exampleIdOrUpdate, update) {
|
|
2122
2629
|
let exampleId;
|
|
@@ -2188,13 +2695,16 @@ export class Client {
|
|
|
2188
2695
|
if (tag !== undefined) {
|
|
2189
2696
|
params.append("tag", tag);
|
|
2190
2697
|
}
|
|
2191
|
-
const response = await this.caller.call(
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2698
|
+
const response = await this.caller.call(async () => {
|
|
2699
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${resolvedDatasetId}/version?${params.toString()}`, {
|
|
2700
|
+
method: "GET",
|
|
2701
|
+
headers: { ...this.headers },
|
|
2702
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2703
|
+
...this.fetchOptions,
|
|
2704
|
+
});
|
|
2705
|
+
await raiseForStatus(res, "read dataset version");
|
|
2706
|
+
return res;
|
|
2196
2707
|
});
|
|
2197
|
-
await raiseForStatus(response, "read dataset version");
|
|
2198
2708
|
return await response.json();
|
|
2199
2709
|
}
|
|
2200
2710
|
async listDatasetSplits({ datasetId, datasetName, asOf, }) {
|
|
@@ -2249,14 +2759,18 @@ export class Client {
|
|
|
2249
2759
|
}),
|
|
2250
2760
|
remove,
|
|
2251
2761
|
};
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2762
|
+
const body = JSON.stringify(data);
|
|
2763
|
+
await this.caller.call(async () => {
|
|
2764
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/${datasetId_}/splits`, {
|
|
2765
|
+
method: "PUT",
|
|
2766
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2767
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2768
|
+
...this.fetchOptions,
|
|
2769
|
+
body,
|
|
2770
|
+
});
|
|
2771
|
+
await raiseForStatus(res, "update dataset splits", true);
|
|
2772
|
+
return res;
|
|
2258
2773
|
});
|
|
2259
|
-
await raiseForStatus(response, "update dataset splits", true);
|
|
2260
2774
|
}
|
|
2261
2775
|
/**
|
|
2262
2776
|
* @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
|
|
@@ -2305,7 +2819,7 @@ export class Client {
|
|
|
2305
2819
|
id: feedbackId ?? uuid.v4(),
|
|
2306
2820
|
run_id: runId,
|
|
2307
2821
|
key,
|
|
2308
|
-
score,
|
|
2822
|
+
score: _formatFeedbackScore(score),
|
|
2309
2823
|
value,
|
|
2310
2824
|
correction,
|
|
2311
2825
|
comment,
|
|
@@ -2314,21 +2828,25 @@ export class Client {
|
|
|
2314
2828
|
feedbackConfig,
|
|
2315
2829
|
session_id: projectId,
|
|
2316
2830
|
};
|
|
2831
|
+
const body = JSON.stringify(feedback);
|
|
2317
2832
|
const url = `${this.apiUrl}/feedback`;
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2833
|
+
await this.caller.call(async () => {
|
|
2834
|
+
const res = await this._fetch(url, {
|
|
2835
|
+
method: "POST",
|
|
2836
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2837
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2838
|
+
...this.fetchOptions,
|
|
2839
|
+
body,
|
|
2840
|
+
});
|
|
2841
|
+
await raiseForStatus(res, "create feedback", true);
|
|
2842
|
+
return res;
|
|
2843
|
+
});
|
|
2326
2844
|
return feedback;
|
|
2327
2845
|
}
|
|
2328
2846
|
async updateFeedback(feedbackId, { score, value, correction, comment, }) {
|
|
2329
2847
|
const feedbackUpdate = {};
|
|
2330
2848
|
if (score !== undefined && score !== null) {
|
|
2331
|
-
feedbackUpdate["score"] = score;
|
|
2849
|
+
feedbackUpdate["score"] = _formatFeedbackScore(score);
|
|
2332
2850
|
}
|
|
2333
2851
|
if (value !== undefined && value !== null) {
|
|
2334
2852
|
feedbackUpdate["value"] = value;
|
|
@@ -2340,14 +2858,18 @@ export class Client {
|
|
|
2340
2858
|
feedbackUpdate["comment"] = comment;
|
|
2341
2859
|
}
|
|
2342
2860
|
assertUuid(feedbackId);
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2861
|
+
const body = JSON.stringify(feedbackUpdate);
|
|
2862
|
+
await this.caller.call(async () => {
|
|
2863
|
+
const res = await this._fetch(`${this.apiUrl}/feedback/${feedbackId}`, {
|
|
2864
|
+
method: "PATCH",
|
|
2865
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2866
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2867
|
+
...this.fetchOptions,
|
|
2868
|
+
body,
|
|
2869
|
+
});
|
|
2870
|
+
await raiseForStatus(res, "update feedback", true);
|
|
2871
|
+
return res;
|
|
2349
2872
|
});
|
|
2350
|
-
await raiseForStatus(response, "update feedback", true);
|
|
2351
2873
|
}
|
|
2352
2874
|
async readFeedback(feedbackId) {
|
|
2353
2875
|
assertUuid(feedbackId);
|
|
@@ -2358,19 +2880,24 @@ export class Client {
|
|
|
2358
2880
|
async deleteFeedback(feedbackId) {
|
|
2359
2881
|
assertUuid(feedbackId);
|
|
2360
2882
|
const path = `/feedback/${feedbackId}`;
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2883
|
+
await this.caller.call(async () => {
|
|
2884
|
+
const res = await this._fetch(this.apiUrl + path, {
|
|
2885
|
+
method: "DELETE",
|
|
2886
|
+
headers: this.headers,
|
|
2887
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2888
|
+
...this.fetchOptions,
|
|
2889
|
+
});
|
|
2890
|
+
await raiseForStatus(res, `delete ${path}`, true);
|
|
2891
|
+
return res;
|
|
2366
2892
|
});
|
|
2367
|
-
await raiseForStatus(response, `delete ${path}`);
|
|
2368
|
-
await response.json();
|
|
2369
2893
|
}
|
|
2370
2894
|
async *listFeedback({ runIds, feedbackKeys, feedbackSourceTypes, } = {}) {
|
|
2371
2895
|
const queryParams = new URLSearchParams();
|
|
2372
2896
|
if (runIds) {
|
|
2373
|
-
|
|
2897
|
+
for (const runId of runIds) {
|
|
2898
|
+
assertUuid(runId);
|
|
2899
|
+
queryParams.append("run", runId);
|
|
2900
|
+
}
|
|
2374
2901
|
}
|
|
2375
2902
|
if (feedbackKeys) {
|
|
2376
2903
|
for (const key of feedbackKeys) {
|
|
@@ -2420,15 +2947,19 @@ export class Client {
|
|
|
2420
2947
|
hours: 3,
|
|
2421
2948
|
};
|
|
2422
2949
|
}
|
|
2423
|
-
const
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2950
|
+
const serializedBody = JSON.stringify(body);
|
|
2951
|
+
const response = await this.caller.call(async () => {
|
|
2952
|
+
const res = await this._fetch(`${this.apiUrl}/feedback/tokens`, {
|
|
2953
|
+
method: "POST",
|
|
2954
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2955
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2956
|
+
...this.fetchOptions,
|
|
2957
|
+
body: serializedBody,
|
|
2958
|
+
});
|
|
2959
|
+
await raiseForStatus(res, "create presigned feedback token");
|
|
2960
|
+
return res;
|
|
2429
2961
|
});
|
|
2430
|
-
|
|
2431
|
-
return result;
|
|
2962
|
+
return await response.json();
|
|
2432
2963
|
}
|
|
2433
2964
|
async createComparativeExperiment({ name, experimentIds, referenceDatasetId, createdAt, description, metadata, id, }) {
|
|
2434
2965
|
if (experimentIds.length === 0) {
|
|
@@ -2453,14 +2984,19 @@ export class Client {
|
|
|
2453
2984
|
};
|
|
2454
2985
|
if (metadata)
|
|
2455
2986
|
body.extra["metadata"] = metadata;
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2987
|
+
const serializedBody = JSON.stringify(body);
|
|
2988
|
+
const response = await this.caller.call(async () => {
|
|
2989
|
+
const res = await this._fetch(`${this.apiUrl}/datasets/comparative`, {
|
|
2990
|
+
method: "POST",
|
|
2991
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2992
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2993
|
+
...this.fetchOptions,
|
|
2994
|
+
body: serializedBody,
|
|
2995
|
+
});
|
|
2996
|
+
await raiseForStatus(res, "create comparative experiment");
|
|
2997
|
+
return res;
|
|
2462
2998
|
});
|
|
2463
|
-
return
|
|
2999
|
+
return response.json();
|
|
2464
3000
|
}
|
|
2465
3001
|
/**
|
|
2466
3002
|
* Retrieves a list of presigned feedback tokens for a given run ID.
|
|
@@ -2562,37 +3098,44 @@ export class Client {
|
|
|
2562
3098
|
* @returns The created AnnotationQueue object
|
|
2563
3099
|
*/
|
|
2564
3100
|
async createAnnotationQueue(options) {
|
|
2565
|
-
const { name, description, queueId } = options;
|
|
3101
|
+
const { name, description, queueId, rubricInstructions } = options;
|
|
2566
3102
|
const body = {
|
|
2567
3103
|
name,
|
|
2568
3104
|
description,
|
|
2569
3105
|
id: queueId || uuid.v4(),
|
|
3106
|
+
rubric_instructions: rubricInstructions,
|
|
2570
3107
|
};
|
|
2571
|
-
const
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
3108
|
+
const serializedBody = JSON.stringify(Object.fromEntries(Object.entries(body).filter(([_, v]) => v !== undefined)));
|
|
3109
|
+
const response = await this.caller.call(async () => {
|
|
3110
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues`, {
|
|
3111
|
+
method: "POST",
|
|
3112
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3113
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3114
|
+
...this.fetchOptions,
|
|
3115
|
+
body: serializedBody,
|
|
3116
|
+
});
|
|
3117
|
+
await raiseForStatus(res, "create annotation queue");
|
|
3118
|
+
return res;
|
|
2577
3119
|
});
|
|
2578
|
-
|
|
2579
|
-
const data = await response.json();
|
|
2580
|
-
return data;
|
|
3120
|
+
return response.json();
|
|
2581
3121
|
}
|
|
2582
3122
|
/**
|
|
2583
3123
|
* Read an annotation queue with the specified queue ID.
|
|
2584
3124
|
* @param queueId - The ID of the annotation queue to read
|
|
2585
|
-
* @returns The
|
|
3125
|
+
* @returns The AnnotationQueueWithDetails object
|
|
2586
3126
|
*/
|
|
2587
3127
|
async readAnnotationQueue(queueId) {
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
3128
|
+
const response = await this.caller.call(async () => {
|
|
3129
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
|
|
3130
|
+
method: "GET",
|
|
3131
|
+
headers: this.headers,
|
|
3132
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3133
|
+
...this.fetchOptions,
|
|
3134
|
+
});
|
|
3135
|
+
await raiseForStatus(res, "read annotation queue");
|
|
3136
|
+
return res;
|
|
3137
|
+
});
|
|
3138
|
+
return response.json();
|
|
2596
3139
|
}
|
|
2597
3140
|
/**
|
|
2598
3141
|
* Update an annotation queue with the specified queue ID.
|
|
@@ -2602,28 +3145,39 @@ export class Client {
|
|
|
2602
3145
|
* @param options.description - The new description for the annotation queue
|
|
2603
3146
|
*/
|
|
2604
3147
|
async updateAnnotationQueue(queueId, options) {
|
|
2605
|
-
const { name, description } = options;
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
3148
|
+
const { name, description, rubricInstructions } = options;
|
|
3149
|
+
const body = JSON.stringify({
|
|
3150
|
+
name,
|
|
3151
|
+
description,
|
|
3152
|
+
rubric_instructions: rubricInstructions,
|
|
3153
|
+
});
|
|
3154
|
+
await this.caller.call(async () => {
|
|
3155
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
|
|
3156
|
+
method: "PATCH",
|
|
3157
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3158
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3159
|
+
...this.fetchOptions,
|
|
3160
|
+
body,
|
|
3161
|
+
});
|
|
3162
|
+
await raiseForStatus(res, "update annotation queue", true);
|
|
3163
|
+
return res;
|
|
2612
3164
|
});
|
|
2613
|
-
await raiseForStatus(response, "update annotation queue");
|
|
2614
3165
|
}
|
|
2615
3166
|
/**
|
|
2616
3167
|
* Delete an annotation queue with the specified queue ID.
|
|
2617
3168
|
* @param queueId - The ID of the annotation queue to delete
|
|
2618
3169
|
*/
|
|
2619
3170
|
async deleteAnnotationQueue(queueId) {
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
3171
|
+
await this.caller.call(async () => {
|
|
3172
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
|
|
3173
|
+
method: "DELETE",
|
|
3174
|
+
headers: { ...this.headers, Accept: "application/json" },
|
|
3175
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3176
|
+
...this.fetchOptions,
|
|
3177
|
+
});
|
|
3178
|
+
await raiseForStatus(res, "delete annotation queue", true);
|
|
3179
|
+
return res;
|
|
2625
3180
|
});
|
|
2626
|
-
await raiseForStatus(response, "delete annotation queue");
|
|
2627
3181
|
}
|
|
2628
3182
|
/**
|
|
2629
3183
|
* Add runs to an annotation queue with the specified queue ID.
|
|
@@ -2631,14 +3185,18 @@ export class Client {
|
|
|
2631
3185
|
* @param runIds - The IDs of the runs to be added to the annotation queue
|
|
2632
3186
|
*/
|
|
2633
3187
|
async addRunsToAnnotationQueue(queueId, runIds) {
|
|
2634
|
-
const
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
3188
|
+
const body = JSON.stringify(runIds.map((id, i) => assertUuid(id, `runIds[${i}]`).toString()));
|
|
3189
|
+
await this.caller.call(async () => {
|
|
3190
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs`, {
|
|
3191
|
+
method: "POST",
|
|
3192
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3193
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3194
|
+
...this.fetchOptions,
|
|
3195
|
+
body,
|
|
3196
|
+
});
|
|
3197
|
+
await raiseForStatus(res, "add runs to annotation queue", true);
|
|
3198
|
+
return res;
|
|
2640
3199
|
});
|
|
2641
|
-
await raiseForStatus(response, "add runs to annotation queue");
|
|
2642
3200
|
}
|
|
2643
3201
|
/**
|
|
2644
3202
|
* Get a run from an annotation queue at the specified index.
|
|
@@ -2649,14 +3207,17 @@ export class Client {
|
|
|
2649
3207
|
*/
|
|
2650
3208
|
async getRunFromAnnotationQueue(queueId, index) {
|
|
2651
3209
|
const baseUrl = `/annotation-queues/${assertUuid(queueId, "queueId")}/run`;
|
|
2652
|
-
const response = await this.caller.call(
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
3210
|
+
const response = await this.caller.call(async () => {
|
|
3211
|
+
const res = await this._fetch(`${this.apiUrl}${baseUrl}/${index}`, {
|
|
3212
|
+
method: "GET",
|
|
3213
|
+
headers: this.headers,
|
|
3214
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3215
|
+
...this.fetchOptions,
|
|
3216
|
+
});
|
|
3217
|
+
await raiseForStatus(res, "get run from annotation queue");
|
|
3218
|
+
return res;
|
|
2657
3219
|
});
|
|
2658
|
-
|
|
2659
|
-
return await response.json();
|
|
3220
|
+
return response.json();
|
|
2660
3221
|
}
|
|
2661
3222
|
/**
|
|
2662
3223
|
* Delete a run from an an annotation queue.
|
|
@@ -2664,27 +3225,33 @@ export class Client {
|
|
|
2664
3225
|
* @param queueRunId - The ID of the run to delete from the annotation queue
|
|
2665
3226
|
*/
|
|
2666
3227
|
async deleteRunFromAnnotationQueue(queueId, queueRunId) {
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
3228
|
+
await this.caller.call(async () => {
|
|
3229
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs/${assertUuid(queueRunId, "queueRunId")}`, {
|
|
3230
|
+
method: "DELETE",
|
|
3231
|
+
headers: { ...this.headers, Accept: "application/json" },
|
|
3232
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3233
|
+
...this.fetchOptions,
|
|
3234
|
+
});
|
|
3235
|
+
await raiseForStatus(res, "delete run from annotation queue", true);
|
|
3236
|
+
return res;
|
|
2672
3237
|
});
|
|
2673
|
-
await raiseForStatus(response, "delete run from annotation queue");
|
|
2674
3238
|
}
|
|
2675
3239
|
/**
|
|
2676
3240
|
* Get the size of an annotation queue.
|
|
2677
3241
|
* @param queueId - The ID of the annotation queue
|
|
2678
3242
|
*/
|
|
2679
3243
|
async getSizeFromAnnotationQueue(queueId) {
|
|
2680
|
-
const response = await this.caller.call(
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
3244
|
+
const response = await this.caller.call(async () => {
|
|
3245
|
+
const res = await this._fetch(`${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/size`, {
|
|
3246
|
+
method: "GET",
|
|
3247
|
+
headers: this.headers,
|
|
3248
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3249
|
+
...this.fetchOptions,
|
|
3250
|
+
});
|
|
3251
|
+
await raiseForStatus(res, "get size from annotation queue");
|
|
3252
|
+
return res;
|
|
2685
3253
|
});
|
|
2686
|
-
|
|
2687
|
-
return await response.json();
|
|
3254
|
+
return response.json();
|
|
2688
3255
|
}
|
|
2689
3256
|
async _currentTenantIsOwner(owner) {
|
|
2690
3257
|
const settings = await this._getSettings();
|
|
@@ -2697,22 +3264,17 @@ export class Client {
|
|
|
2697
3264
|
Requested tenant: ${owner}`);
|
|
2698
3265
|
}
|
|
2699
3266
|
async _getLatestCommitHash(promptOwnerAndName) {
|
|
2700
|
-
const
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
const error = new Error(`Error ${res.status}: ${res.statusText}\n${detail}`);
|
|
2712
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2713
|
-
error.statusCode = res.status;
|
|
2714
|
-
throw error;
|
|
2715
|
-
}
|
|
3267
|
+
const response = await this.caller.call(async () => {
|
|
3268
|
+
const res = await this._fetch(`${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, {
|
|
3269
|
+
method: "GET",
|
|
3270
|
+
headers: this.headers,
|
|
3271
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3272
|
+
...this.fetchOptions,
|
|
3273
|
+
});
|
|
3274
|
+
await raiseForStatus(res, "get latest commit hash");
|
|
3275
|
+
return res;
|
|
3276
|
+
});
|
|
3277
|
+
const json = await response.json();
|
|
2716
3278
|
if (json.commits.length === 0) {
|
|
2717
3279
|
return undefined;
|
|
2718
3280
|
}
|
|
@@ -2720,15 +3282,19 @@ export class Client {
|
|
|
2720
3282
|
}
|
|
2721
3283
|
async _likeOrUnlikePrompt(promptIdentifier, like) {
|
|
2722
3284
|
const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier);
|
|
2723
|
-
const
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
3285
|
+
const body = JSON.stringify({ like: like });
|
|
3286
|
+
const response = await this.caller.call(async () => {
|
|
3287
|
+
const res = await this._fetch(`${this.apiUrl}/likes/${owner}/${promptName}`, {
|
|
3288
|
+
method: "POST",
|
|
3289
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3290
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3291
|
+
...this.fetchOptions,
|
|
3292
|
+
body,
|
|
3293
|
+
});
|
|
3294
|
+
await raiseForStatus(res, `${like ? "like" : "unlike"} prompt`);
|
|
3295
|
+
return res;
|
|
3296
|
+
});
|
|
3297
|
+
return response.json();
|
|
2732
3298
|
}
|
|
2733
3299
|
async _getPromptUrl(promptIdentifier) {
|
|
2734
3300
|
const [owner, promptName, commitHash] = parsePromptIdentifier(promptIdentifier);
|
|
@@ -2782,18 +3348,21 @@ export class Client {
|
|
|
2782
3348
|
}
|
|
2783
3349
|
async getPrompt(promptIdentifier) {
|
|
2784
3350
|
const [owner, promptName, _] = parsePromptIdentifier(promptIdentifier);
|
|
2785
|
-
const response = await this.caller.call(
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
3351
|
+
const response = await this.caller.call(async () => {
|
|
3352
|
+
const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3353
|
+
method: "GET",
|
|
3354
|
+
headers: this.headers,
|
|
3355
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3356
|
+
...this.fetchOptions,
|
|
3357
|
+
});
|
|
3358
|
+
if (res?.status === 404) {
|
|
3359
|
+
return null;
|
|
3360
|
+
}
|
|
3361
|
+
await raiseForStatus(res, "get prompt");
|
|
3362
|
+
return res;
|
|
2790
3363
|
});
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
}
|
|
2794
|
-
await raiseForStatus(response, "get prompt");
|
|
2795
|
-
const result = await response.json();
|
|
2796
|
-
if (result.repo) {
|
|
3364
|
+
const result = await response?.json();
|
|
3365
|
+
if (result?.repo) {
|
|
2797
3366
|
return result.repo;
|
|
2798
3367
|
}
|
|
2799
3368
|
else {
|
|
@@ -2804,7 +3373,7 @@ export class Client {
|
|
|
2804
3373
|
const settings = await this._getSettings();
|
|
2805
3374
|
if (options?.isPublic && !settings.tenant_handle) {
|
|
2806
3375
|
throw new Error(`Cannot create a public prompt without first\n
|
|
2807
|
-
creating a LangChain Hub handle.
|
|
3376
|
+
creating a LangChain Hub handle.
|
|
2808
3377
|
You can add a handle by creating a public prompt at:\n
|
|
2809
3378
|
https://smith.langchain.com/prompts`);
|
|
2810
3379
|
}
|
|
@@ -2819,14 +3388,18 @@ export class Client {
|
|
|
2819
3388
|
...(options?.tags && { tags: options.tags }),
|
|
2820
3389
|
is_public: !!options?.isPublic,
|
|
2821
3390
|
};
|
|
2822
|
-
const
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
3391
|
+
const body = JSON.stringify(data);
|
|
3392
|
+
const response = await this.caller.call(async () => {
|
|
3393
|
+
const res = await this._fetch(`${this.apiUrl}/repos/`, {
|
|
3394
|
+
method: "POST",
|
|
3395
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3396
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3397
|
+
...this.fetchOptions,
|
|
3398
|
+
body,
|
|
3399
|
+
});
|
|
3400
|
+
await raiseForStatus(res, "create prompt");
|
|
3401
|
+
return res;
|
|
3402
|
+
});
|
|
2830
3403
|
const { repo } = await response.json();
|
|
2831
3404
|
return repo;
|
|
2832
3405
|
}
|
|
@@ -2842,14 +3415,18 @@ export class Client {
|
|
|
2842
3415
|
manifest: JSON.parse(JSON.stringify(object)),
|
|
2843
3416
|
parent_commit: resolvedParentCommitHash,
|
|
2844
3417
|
};
|
|
2845
|
-
const
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
3418
|
+
const body = JSON.stringify(payload);
|
|
3419
|
+
const response = await this.caller.call(async () => {
|
|
3420
|
+
const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}`, {
|
|
3421
|
+
method: "POST",
|
|
3422
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
3423
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3424
|
+
...this.fetchOptions,
|
|
3425
|
+
body,
|
|
3426
|
+
});
|
|
3427
|
+
await raiseForStatus(res, "create commit");
|
|
3428
|
+
return res;
|
|
3429
|
+
});
|
|
2853
3430
|
const result = await response.json();
|
|
2854
3431
|
return this._getPromptUrl(`${owner}/${promptName}${result.commit_hash ? `:${result.commit_hash}` : ""}`);
|
|
2855
3432
|
}
|
|
@@ -2862,8 +3439,8 @@ export class Client {
|
|
|
2862
3439
|
return this._updateExamplesMultipart(datasetId, updates);
|
|
2863
3440
|
}
|
|
2864
3441
|
async _updateExamplesMultipart(datasetId, updates = []) {
|
|
2865
|
-
if (!(await this.
|
|
2866
|
-
throw new Error("Your LangSmith
|
|
3442
|
+
if (!(await this._getDatasetExamplesMultiPartSupport())) {
|
|
3443
|
+
throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
|
|
2867
3444
|
}
|
|
2868
3445
|
const formData = new FormData();
|
|
2869
3446
|
for (const example of updates) {
|
|
@@ -2874,14 +3451,14 @@ export class Client {
|
|
|
2874
3451
|
...(example.split && { split: example.split }),
|
|
2875
3452
|
};
|
|
2876
3453
|
// Add main example data
|
|
2877
|
-
const stringifiedExample = serializePayloadForTracing(exampleBody);
|
|
3454
|
+
const stringifiedExample = serializePayloadForTracing(exampleBody, `Serializing body for example with id: ${exampleId}`);
|
|
2878
3455
|
const exampleBlob = new Blob([stringifiedExample], {
|
|
2879
3456
|
type: "application/json",
|
|
2880
3457
|
});
|
|
2881
3458
|
formData.append(exampleId, exampleBlob);
|
|
2882
3459
|
// Add inputs if present
|
|
2883
3460
|
if (example.inputs) {
|
|
2884
|
-
const stringifiedInputs = serializePayloadForTracing(example.inputs);
|
|
3461
|
+
const stringifiedInputs = serializePayloadForTracing(example.inputs, `Serializing inputs for example with id: ${exampleId}`);
|
|
2885
3462
|
const inputsBlob = new Blob([stringifiedInputs], {
|
|
2886
3463
|
type: "application/json",
|
|
2887
3464
|
});
|
|
@@ -2889,7 +3466,7 @@ export class Client {
|
|
|
2889
3466
|
}
|
|
2890
3467
|
// Add outputs if present
|
|
2891
3468
|
if (example.outputs) {
|
|
2892
|
-
const stringifiedOutputs = serializePayloadForTracing(example.outputs);
|
|
3469
|
+
const stringifiedOutputs = serializePayloadForTracing(example.outputs, `Serializing outputs whle updating example with id: ${exampleId}`);
|
|
2893
3470
|
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
2894
3471
|
type: "application/json",
|
|
2895
3472
|
});
|
|
@@ -2914,7 +3491,7 @@ export class Client {
|
|
|
2914
3491
|
}
|
|
2915
3492
|
}
|
|
2916
3493
|
if (example.attachments_operations) {
|
|
2917
|
-
const stringifiedAttachmentsOperations = serializePayloadForTracing(example.attachments_operations);
|
|
3494
|
+
const stringifiedAttachmentsOperations = serializePayloadForTracing(example.attachments_operations, `Serializing attachments while updating example with id: ${exampleId}`);
|
|
2918
3495
|
const attachmentsOperationsBlob = new Blob([stringifiedAttachmentsOperations], {
|
|
2919
3496
|
type: "application/json",
|
|
2920
3497
|
});
|
|
@@ -2922,13 +3499,18 @@ export class Client {
|
|
|
2922
3499
|
}
|
|
2923
3500
|
}
|
|
2924
3501
|
const datasetIdToUse = datasetId ?? updates[0]?.dataset_id;
|
|
2925
|
-
const response = await this.caller.call(
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
3502
|
+
const response = await this.caller.call(async () => {
|
|
3503
|
+
const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetIdToUse}/examples`)}`, {
|
|
3504
|
+
method: "PATCH",
|
|
3505
|
+
headers: this.headers,
|
|
3506
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3507
|
+
...this.fetchOptions,
|
|
3508
|
+
body: formData,
|
|
3509
|
+
});
|
|
3510
|
+
await raiseForStatus(res, "update examples");
|
|
3511
|
+
return res;
|
|
2929
3512
|
});
|
|
2930
|
-
|
|
2931
|
-
return result;
|
|
3513
|
+
return response.json();
|
|
2932
3514
|
}
|
|
2933
3515
|
/**
|
|
2934
3516
|
* Upload examples with attachments using multipart form data.
|
|
@@ -2940,8 +3522,8 @@ export class Client {
|
|
|
2940
3522
|
return this._uploadExamplesMultipart(datasetId, uploads);
|
|
2941
3523
|
}
|
|
2942
3524
|
async _uploadExamplesMultipart(datasetId, uploads = []) {
|
|
2943
|
-
if (!(await this.
|
|
2944
|
-
throw new Error("Your LangSmith
|
|
3525
|
+
if (!(await this._getDatasetExamplesMultiPartSupport())) {
|
|
3526
|
+
throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");
|
|
2945
3527
|
}
|
|
2946
3528
|
const formData = new FormData();
|
|
2947
3529
|
for (const example of uploads) {
|
|
@@ -2960,14 +3542,14 @@ export class Client {
|
|
|
2960
3542
|
}),
|
|
2961
3543
|
};
|
|
2962
3544
|
// Add main example data
|
|
2963
|
-
const stringifiedExample = serializePayloadForTracing(exampleBody);
|
|
3545
|
+
const stringifiedExample = serializePayloadForTracing(exampleBody, `Serializing body for uploaded example with id: ${exampleId}`);
|
|
2964
3546
|
const exampleBlob = new Blob([stringifiedExample], {
|
|
2965
3547
|
type: "application/json",
|
|
2966
3548
|
});
|
|
2967
3549
|
formData.append(exampleId, exampleBlob);
|
|
2968
3550
|
// Add inputs if present
|
|
2969
3551
|
if (example.inputs) {
|
|
2970
|
-
const stringifiedInputs = serializePayloadForTracing(example.inputs);
|
|
3552
|
+
const stringifiedInputs = serializePayloadForTracing(example.inputs, `Serializing inputs for uploaded example with id: ${exampleId}`);
|
|
2971
3553
|
const inputsBlob = new Blob([stringifiedInputs], {
|
|
2972
3554
|
type: "application/json",
|
|
2973
3555
|
});
|
|
@@ -2975,7 +3557,7 @@ export class Client {
|
|
|
2975
3557
|
}
|
|
2976
3558
|
// Add outputs if present
|
|
2977
3559
|
if (example.outputs) {
|
|
2978
|
-
const stringifiedOutputs = serializePayloadForTracing(example.outputs);
|
|
3560
|
+
const stringifiedOutputs = serializePayloadForTracing(example.outputs, `Serializing outputs for uploaded example with id: ${exampleId}`);
|
|
2979
3561
|
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
2980
3562
|
type: "application/json",
|
|
2981
3563
|
});
|
|
@@ -3000,13 +3582,18 @@ export class Client {
|
|
|
3000
3582
|
}
|
|
3001
3583
|
}
|
|
3002
3584
|
}
|
|
3003
|
-
const response = await this.caller.call(
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3585
|
+
const response = await this.caller.call(async () => {
|
|
3586
|
+
const res = await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${datasetId}/examples`)}`, {
|
|
3587
|
+
method: "POST",
|
|
3588
|
+
headers: this.headers,
|
|
3589
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3590
|
+
...this.fetchOptions,
|
|
3591
|
+
body: formData,
|
|
3592
|
+
});
|
|
3593
|
+
await raiseForStatus(res, "upload examples");
|
|
3594
|
+
return res;
|
|
3007
3595
|
});
|
|
3008
|
-
|
|
3009
|
-
return result;
|
|
3596
|
+
return response.json();
|
|
3010
3597
|
}
|
|
3011
3598
|
async updatePrompt(promptIdentifier, options) {
|
|
3012
3599
|
if (!(await this.promptExists(promptIdentifier))) {
|
|
@@ -3031,17 +3618,21 @@ export class Client {
|
|
|
3031
3618
|
if (Object.keys(payload).length === 0) {
|
|
3032
3619
|
throw new Error("No valid update options provided");
|
|
3033
3620
|
}
|
|
3034
|
-
const
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3621
|
+
const body = JSON.stringify(payload);
|
|
3622
|
+
const response = await this.caller.call(async () => {
|
|
3623
|
+
const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3624
|
+
method: "PATCH",
|
|
3625
|
+
headers: {
|
|
3626
|
+
...this.headers,
|
|
3627
|
+
"Content-Type": "application/json",
|
|
3628
|
+
},
|
|
3629
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3630
|
+
...this.fetchOptions,
|
|
3631
|
+
body,
|
|
3632
|
+
});
|
|
3633
|
+
await raiseForStatus(res, "update prompt");
|
|
3634
|
+
return res;
|
|
3043
3635
|
});
|
|
3044
|
-
await raiseForStatus(response, "update prompt");
|
|
3045
3636
|
return response.json();
|
|
3046
3637
|
}
|
|
3047
3638
|
async deletePrompt(promptIdentifier) {
|
|
@@ -3052,23 +3643,30 @@ export class Client {
|
|
|
3052
3643
|
if (!(await this._currentTenantIsOwner(owner))) {
|
|
3053
3644
|
throw await this._ownerConflictError("delete a prompt", owner);
|
|
3054
3645
|
}
|
|
3055
|
-
const response = await this.caller.call(
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3646
|
+
const response = await this.caller.call(async () => {
|
|
3647
|
+
const res = await this._fetch(`${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3648
|
+
method: "DELETE",
|
|
3649
|
+
headers: this.headers,
|
|
3650
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3651
|
+
...this.fetchOptions,
|
|
3652
|
+
});
|
|
3653
|
+
await raiseForStatus(res, "delete prompt");
|
|
3654
|
+
return res;
|
|
3060
3655
|
});
|
|
3061
|
-
return
|
|
3656
|
+
return response.json();
|
|
3062
3657
|
}
|
|
3063
3658
|
async pullPromptCommit(promptIdentifier, options) {
|
|
3064
3659
|
const [owner, promptName, commitHash] = parsePromptIdentifier(promptIdentifier);
|
|
3065
|
-
const response = await this.caller.call(
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3660
|
+
const response = await this.caller.call(async () => {
|
|
3661
|
+
const res = await this._fetch(`${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
|
|
3662
|
+
method: "GET",
|
|
3663
|
+
headers: this.headers,
|
|
3664
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3665
|
+
...this.fetchOptions,
|
|
3666
|
+
});
|
|
3667
|
+
await raiseForStatus(res, "pull prompt commit");
|
|
3668
|
+
return res;
|
|
3070
3669
|
});
|
|
3071
|
-
await raiseForStatus(response, "pull prompt commit");
|
|
3072
3670
|
const result = await response.json();
|
|
3073
3671
|
return {
|
|
3074
3672
|
owner,
|
|
@@ -3221,15 +3819,18 @@ export class Client {
|
|
|
3221
3819
|
*
|
|
3222
3820
|
* @returns A promise that resolves once all currently pending traces have sent.
|
|
3223
3821
|
*/
|
|
3224
|
-
awaitPendingTraceBatches() {
|
|
3822
|
+
async awaitPendingTraceBatches() {
|
|
3225
3823
|
if (this.manualFlushMode) {
|
|
3226
3824
|
console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches.");
|
|
3227
3825
|
return Promise.resolve();
|
|
3228
3826
|
}
|
|
3229
|
-
|
|
3827
|
+
await Promise.all([
|
|
3230
3828
|
...this.autoBatchQueue.items.map(({ itemPromise }) => itemPromise),
|
|
3231
3829
|
this.batchIngestCaller.queue.onIdle(),
|
|
3232
3830
|
]);
|
|
3831
|
+
if (this.langSmithToOTELTranslator !== undefined) {
|
|
3832
|
+
await getDefaultOTLPTracerComponents()?.DEFAULT_LANGSMITH_SPAN_PROCESSOR?.forceFlush();
|
|
3833
|
+
}
|
|
3233
3834
|
}
|
|
3234
3835
|
}
|
|
3235
3836
|
function isExampleCreate(input) {
|