@nocobase/plugin-ai 1.6.0-beta.17
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/LICENSE.txt +161 -0
- package/README.md +1 -0
- package/build.config.ts +165 -0
- package/client.d.ts +2 -0
- package/client.js +1 -0
- package/dist/client/6f221c7c3acd67ae.js +10 -0
- package/dist/client/83ce71fb5895b112.js +10 -0
- package/dist/client/chat-settings/Messages.d.ts +11 -0
- package/dist/client/index.d.ts +22 -0
- package/dist/client/index.js +10 -0
- package/dist/client/llm-providers/components/Chat.d.ts +10 -0
- package/dist/client/llm-providers/components/Messages.d.ts +10 -0
- package/dist/client/llm-providers/components/ModelSelect.d.ts +10 -0
- package/dist/client/llm-providers/components/StructuredOutput.d.ts +10 -0
- package/dist/client/llm-providers/deepseek/ModelSettings.d.ts +10 -0
- package/dist/client/llm-providers/deepseek/index.d.ts +10 -0
- package/dist/client/llm-providers/openai/ModelSettings.d.ts +10 -0
- package/dist/client/llm-providers/openai/ProviderSettings.d.ts +10 -0
- package/dist/client/llm-providers/openai/index.d.ts +10 -0
- package/dist/client/llm-services/LLMServices.d.ts +12 -0
- package/dist/client/llm-services/llm-providers.d.ts +24 -0
- package/dist/client/locale.d.ts +11 -0
- package/dist/client/manager/ai-manager.d.ts +23 -0
- package/dist/client/schemas/llms.d.ts +253 -0
- package/dist/client/workflow/nodes/llm/ModelSettings.d.ts +11 -0
- package/dist/client/workflow/nodes/llm/index.d.ts +59 -0
- package/dist/collections/llm-services.d.ts +34 -0
- package/dist/collections/llm-services.js +63 -0
- package/dist/externalVersion.js +26 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +48 -0
- package/dist/locale/en-US.json +25 -0
- package/dist/locale/zh-CN.json +25 -0
- package/dist/node_modules/@langchain/core/LICENSE +21 -0
- package/dist/node_modules/@langchain/core/agents.cjs +1 -0
- package/dist/node_modules/@langchain/core/agents.d.cts +1 -0
- package/dist/node_modules/@langchain/core/agents.d.ts +1 -0
- package/dist/node_modules/@langchain/core/agents.js +1 -0
- package/dist/node_modules/@langchain/core/caches.cjs +1 -0
- package/dist/node_modules/@langchain/core/caches.d.cts +1 -0
- package/dist/node_modules/@langchain/core/caches.d.ts +1 -0
- package/dist/node_modules/@langchain/core/caches.js +1 -0
- package/dist/node_modules/@langchain/core/callbacks/base.cjs +1 -0
- package/dist/node_modules/@langchain/core/callbacks/base.d.cts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/base.d.ts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/base.js +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch/web.cjs +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch/web.d.cts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch/web.d.ts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch/web.js +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch.cjs +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch.d.cts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch.d.ts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/dispatch.js +1 -0
- package/dist/node_modules/@langchain/core/callbacks/manager.cjs +1 -0
- package/dist/node_modules/@langchain/core/callbacks/manager.d.cts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/manager.d.ts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/manager.js +1 -0
- package/dist/node_modules/@langchain/core/callbacks/promises.cjs +1 -0
- package/dist/node_modules/@langchain/core/callbacks/promises.d.cts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/promises.d.ts +1 -0
- package/dist/node_modules/@langchain/core/callbacks/promises.js +1 -0
- package/dist/node_modules/@langchain/core/chat_history.cjs +1 -0
- package/dist/node_modules/@langchain/core/chat_history.d.cts +1 -0
- package/dist/node_modules/@langchain/core/chat_history.d.ts +1 -0
- package/dist/node_modules/@langchain/core/chat_history.js +1 -0
- package/dist/node_modules/@langchain/core/context.cjs +1 -0
- package/dist/node_modules/@langchain/core/context.d.cts +1 -0
- package/dist/node_modules/@langchain/core/context.d.ts +1 -0
- package/dist/node_modules/@langchain/core/context.js +1 -0
- package/dist/node_modules/@langchain/core/dist/agents.cjs +2 -0
- package/dist/node_modules/@langchain/core/dist/agents.d.ts +13 -0
- package/dist/node_modules/@langchain/core/dist/agents.js +1 -0
- package/dist/node_modules/@langchain/core/dist/caches/base.cjs +89 -0
- package/dist/node_modules/@langchain/core/dist/caches/base.d.ts +56 -0
- package/dist/node_modules/@langchain/core/dist/caches/base.js +81 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/base.cjs +183 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/base.d.ts +291 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/base.js +154 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/index.cjs +49 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/index.d.ts +35 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/index.js +45 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/web.cjs +59 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/web.d.ts +32 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/dispatch/web.js +55 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.cjs +890 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.d.ts +179 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/manager.js +876 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/promises.cjs +6 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/promises.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/callbacks/promises.js +2 -0
- package/dist/node_modules/@langchain/core/dist/chat_history.cjs +123 -0
- package/dist/node_modules/@langchain/core/dist/chat_history.d.ts +92 -0
- package/dist/node_modules/@langchain/core/dist/chat_history.js +117 -0
- package/dist/node_modules/@langchain/core/dist/context.cjs +18 -0
- package/dist/node_modules/@langchain/core/dist/context.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/context.js +13 -0
- package/dist/node_modules/@langchain/core/dist/document_loaders/base.cjs +24 -0
- package/dist/node_modules/@langchain/core/dist/document_loaders/base.d.ts +28 -0
- package/dist/node_modules/@langchain/core/dist/document_loaders/base.js +20 -0
- package/dist/node_modules/@langchain/core/dist/document_loaders/langsmith.cjs +198 -0
- package/dist/node_modules/@langchain/core/dist/document_loaders/langsmith.d.ts +96 -0
- package/dist/node_modules/@langchain/core/dist/document_loaders/langsmith.js +194 -0
- package/dist/node_modules/@langchain/core/dist/documents/document.cjs +42 -0
- package/dist/node_modules/@langchain/core/dist/documents/document.d.ts +37 -0
- package/dist/node_modules/@langchain/core/dist/documents/document.js +38 -0
- package/dist/node_modules/@langchain/core/dist/documents/index.cjs +18 -0
- package/dist/node_modules/@langchain/core/dist/documents/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/documents/index.js +2 -0
- package/dist/node_modules/@langchain/core/dist/documents/transformers.cjs +51 -0
- package/dist/node_modules/@langchain/core/dist/documents/transformers.d.ts +38 -0
- package/dist/node_modules/@langchain/core/dist/documents/transformers.js +46 -0
- package/dist/node_modules/@langchain/core/dist/embeddings.cjs +24 -0
- package/dist/node_modules/@langchain/core/dist/embeddings.d.ts +50 -0
- package/dist/node_modules/@langchain/core/dist/embeddings.js +20 -0
- package/dist/node_modules/@langchain/core/dist/errors/index.cjs +11 -0
- package/dist/node_modules/@langchain/core/dist/errors/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/errors/index.js +7 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/base.cjs +19 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/base.d.ts +20 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/base.js +15 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/conditional.cjs +76 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/conditional.d.ts +63 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/conditional.js +69 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/index.cjs +20 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/index.js +4 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/length_based.cjs +150 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/length_based.d.ts +89 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/length_based.js +146 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/semantic_similarity.cjs +139 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/semantic_similarity.d.ts +91 -0
- package/dist/node_modules/@langchain/core/dist/example_selectors/semantic_similarity.js +135 -0
- package/dist/node_modules/@langchain/core/dist/index.cjs +63 -0
- package/dist/node_modules/@langchain/core/dist/index.d.ts +63 -0
- package/dist/node_modules/@langchain/core/dist/index.js +63 -0
- package/dist/node_modules/@langchain/core/dist/indexing/base.cjs +272 -0
- package/dist/node_modules/@langchain/core/dist/indexing/base.d.ts +114 -0
- package/dist/node_modules/@langchain/core/dist/indexing/base.js +263 -0
- package/dist/node_modules/@langchain/core/dist/indexing/index.cjs +18 -0
- package/dist/node_modules/@langchain/core/dist/indexing/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/indexing/index.js +2 -0
- package/dist/node_modules/@langchain/core/dist/indexing/record_manager.cjs +18 -0
- package/dist/node_modules/@langchain/core/dist/indexing/record_manager.d.ts +64 -0
- package/dist/node_modules/@langchain/core/dist/indexing/record_manager.js +14 -0
- package/dist/node_modules/@langchain/core/dist/language_models/base.cjs +283 -0
- package/dist/node_modules/@langchain/core/dist/language_models/base.d.ts +226 -0
- package/dist/node_modules/@langchain/core/dist/language_models/base.js +273 -0
- package/dist/node_modules/@langchain/core/dist/language_models/chat_models.cjs +603 -0
- package/dist/node_modules/@langchain/core/dist/language_models/chat_models.d.ts +199 -0
- package/dist/node_modules/@langchain/core/dist/language_models/chat_models.js +597 -0
- package/dist/node_modules/@langchain/core/dist/language_models/llms.cjs +379 -0
- package/dist/node_modules/@langchain/core/dist/language_models/llms.d.ts +129 -0
- package/dist/node_modules/@langchain/core/dist/language_models/llms.js +374 -0
- package/dist/node_modules/@langchain/core/dist/load/import_constants.cjs +5 -0
- package/dist/node_modules/@langchain/core/dist/load/import_constants.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/load/import_constants.js +2 -0
- package/dist/node_modules/@langchain/core/dist/load/import_map.cjs +70 -0
- package/dist/node_modules/@langchain/core/dist/load/import_map.d.ts +43 -0
- package/dist/node_modules/@langchain/core/dist/load/import_map.js +44 -0
- package/dist/node_modules/@langchain/core/dist/load/import_type.cjs +3 -0
- package/dist/node_modules/@langchain/core/dist/load/import_type.d.ts +4 -0
- package/dist/node_modules/@langchain/core/dist/load/import_type.js +2 -0
- package/dist/node_modules/@langchain/core/dist/load/index.cjs +189 -0
- package/dist/node_modules/@langchain/core/dist/load/index.d.ts +7 -0
- package/dist/node_modules/@langchain/core/dist/load/index.js +162 -0
- package/dist/node_modules/@langchain/core/dist/load/map_keys.cjs +26 -0
- package/dist/node_modules/@langchain/core/dist/load/map_keys.d.ts +9 -0
- package/dist/node_modules/@langchain/core/dist/load/map_keys.js +17 -0
- package/dist/node_modules/@langchain/core/dist/load/serializable.cjs +192 -0
- package/dist/node_modules/@langchain/core/dist/load/serializable.d.ts +76 -0
- package/dist/node_modules/@langchain/core/dist/load/serializable.js +187 -0
- package/dist/node_modules/@langchain/core/dist/memory.cjs +63 -0
- package/dist/node_modules/@langchain/core/dist/memory.d.ts +62 -0
- package/dist/node_modules/@langchain/core/dist/memory.js +56 -0
- package/dist/node_modules/@langchain/core/dist/messages/ai.cjs +327 -0
- package/dist/node_modules/@langchain/core/dist/messages/ai.d.ts +120 -0
- package/dist/node_modules/@langchain/core/dist/messages/ai.js +320 -0
- package/dist/node_modules/@langchain/core/dist/messages/base.cjs +350 -0
- package/dist/node_modules/@langchain/core/dist/messages/base.d.ts +189 -0
- package/dist/node_modules/@langchain/core/dist/messages/base.js +336 -0
- package/dist/node_modules/@langchain/core/dist/messages/chat.cjs +92 -0
- package/dist/node_modules/@langchain/core/dist/messages/chat.d.ts +32 -0
- package/dist/node_modules/@langchain/core/dist/messages/chat.js +85 -0
- package/dist/node_modules/@langchain/core/dist/messages/function.cjs +55 -0
- package/dist/node_modules/@langchain/core/dist/messages/function.d.ts +26 -0
- package/dist/node_modules/@langchain/core/dist/messages/function.js +48 -0
- package/dist/node_modules/@langchain/core/dist/messages/human.cjs +45 -0
- package/dist/node_modules/@langchain/core/dist/messages/human.d.ts +19 -0
- package/dist/node_modules/@langchain/core/dist/messages/human.js +38 -0
- package/dist/node_modules/@langchain/core/dist/messages/index.cjs +33 -0
- package/dist/node_modules/@langchain/core/dist/messages/index.d.ts +10 -0
- package/dist/node_modules/@langchain/core/dist/messages/index.js +12 -0
- package/dist/node_modules/@langchain/core/dist/messages/modifier.cjs +35 -0
- package/dist/node_modules/@langchain/core/dist/messages/modifier.d.ts +19 -0
- package/dist/node_modules/@langchain/core/dist/messages/modifier.js +31 -0
- package/dist/node_modules/@langchain/core/dist/messages/system.cjs +45 -0
- package/dist/node_modules/@langchain/core/dist/messages/system.d.ts +19 -0
- package/dist/node_modules/@langchain/core/dist/messages/system.js +38 -0
- package/dist/node_modules/@langchain/core/dist/messages/tool.cjs +191 -0
- package/dist/node_modules/@langchain/core/dist/messages/tool.d.ts +159 -0
- package/dist/node_modules/@langchain/core/dist/messages/tool.js +182 -0
- package/dist/node_modules/@langchain/core/dist/messages/transformers.cjs +459 -0
- package/dist/node_modules/@langchain/core/dist/messages/transformers.d.ts +466 -0
- package/dist/node_modules/@langchain/core/dist/messages/transformers.js +452 -0
- package/dist/node_modules/@langchain/core/dist/messages/utils.cjs +292 -0
- package/dist/node_modules/@langchain/core/dist/messages/utils.d.ts +31 -0
- package/dist/node_modules/@langchain/core/dist/messages/utils.js +283 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/base.cjs +124 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/base.d.ts +103 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/base.js +118 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/bytes.cjs +41 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/bytes.d.ts +13 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/bytes.js +37 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/index.cjs +24 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/index.d.ts +8 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/index.js +8 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/json.cjs +52 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/json.d.ts +17 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/json.js +47 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/list.cjs +244 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/list.d.ts +76 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/list.js +236 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/index.cjs +17 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/index.js +1 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/json_output_functions_parsers.cjs +207 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +80 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_functions/json_output_functions_parsers.js +201 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/index.cjs +17 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/index.js +1 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +262 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +78 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/openai_tools/json_output_tools_parsers.js +254 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/string.cjs +86 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/string.d.ts +39 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/string.js +82 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/structured.cjs +196 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/structured.d.ts +88 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/structured.js +190 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/transform.cjs +112 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/transform.d.ts +34 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/transform.js +107 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/xml.cjs +146 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/xml.d.ts +29 -0
- package/dist/node_modules/@langchain/core/dist/output_parsers/xml.js +141 -0
- package/dist/node_modules/@langchain/core/dist/outputs.cjs +59 -0
- package/dist/node_modules/@langchain/core/dist/outputs.d.ts +61 -0
- package/dist/node_modules/@langchain/core/dist/outputs.js +54 -0
- package/dist/node_modules/@langchain/core/dist/prompt_values.cjs +153 -0
- package/dist/node_modules/@langchain/core/dist/prompt_values.d.ts +78 -0
- package/dist/node_modules/@langchain/core/dist/prompt_values.js +146 -0
- package/dist/node_modules/@langchain/core/dist/prompts/base.cjs +142 -0
- package/dist/node_modules/@langchain/core/dist/prompts/base.d.ts +95 -0
- package/dist/node_modules/@langchain/core/dist/prompts/base.js +138 -0
- package/dist/node_modules/@langchain/core/dist/prompts/chat.cjs +764 -0
- package/dist/node_modules/@langchain/core/dist/prompts/chat.d.ts +240 -0
- package/dist/node_modules/@langchain/core/dist/prompts/chat.js +752 -0
- package/dist/node_modules/@langchain/core/dist/prompts/few_shot.cjs +355 -0
- package/dist/node_modules/@langchain/core/dist/prompts/few_shot.d.ts +195 -0
- package/dist/node_modules/@langchain/core/dist/prompts/few_shot.js +350 -0
- package/dist/node_modules/@langchain/core/dist/prompts/image.cjs +128 -0
- package/dist/node_modules/@langchain/core/dist/prompts/image.d.ts +70 -0
- package/dist/node_modules/@langchain/core/dist/prompts/image.js +124 -0
- package/dist/node_modules/@langchain/core/dist/prompts/index.cjs +26 -0
- package/dist/node_modules/@langchain/core/dist/prompts/index.d.ts +10 -0
- package/dist/node_modules/@langchain/core/dist/prompts/index.js +10 -0
- package/dist/node_modules/@langchain/core/dist/prompts/pipeline.cjs +144 -0
- package/dist/node_modules/@langchain/core/dist/prompts/pipeline.d.ts +98 -0
- package/dist/node_modules/@langchain/core/dist/prompts/pipeline.js +140 -0
- package/dist/node_modules/@langchain/core/dist/prompts/prompt.cjs +166 -0
- package/dist/node_modules/@langchain/core/dist/prompts/prompt.d.ts +107 -0
- package/dist/node_modules/@langchain/core/dist/prompts/prompt.js +162 -0
- package/dist/node_modules/@langchain/core/dist/prompts/serde.cjs +2 -0
- package/dist/node_modules/@langchain/core/dist/prompts/serde.d.ts +43 -0
- package/dist/node_modules/@langchain/core/dist/prompts/serde.js +1 -0
- package/dist/node_modules/@langchain/core/dist/prompts/string.cjs +25 -0
- package/dist/node_modules/@langchain/core/dist/prompts/string.d.ts +17 -0
- package/dist/node_modules/@langchain/core/dist/prompts/string.js +21 -0
- package/dist/node_modules/@langchain/core/dist/prompts/structured.cjs +64 -0
- package/dist/node_modules/@langchain/core/dist/prompts/structured.d.ts +19 -0
- package/dist/node_modules/@langchain/core/dist/prompts/structured.js +60 -0
- package/dist/node_modules/@langchain/core/dist/prompts/template.cjs +169 -0
- package/dist/node_modules/@langchain/core/dist/prompts/template.d.ts +43 -0
- package/dist/node_modules/@langchain/core/dist/prompts/template.js +156 -0
- package/dist/node_modules/@langchain/core/dist/retrievers/document_compressors/base.cjs +13 -0
- package/dist/node_modules/@langchain/core/dist/retrievers/document_compressors/base.d.ts +18 -0
- package/dist/node_modules/@langchain/core/dist/retrievers/document_compressors/base.js +9 -0
- package/dist/node_modules/@langchain/core/dist/retrievers/index.cjs +131 -0
- package/dist/node_modules/@langchain/core/dist/retrievers/index.d.ts +134 -0
- package/dist/node_modules/@langchain/core/dist/retrievers/index.js +127 -0
- package/dist/node_modules/@langchain/core/dist/runnables/base.cjs +2399 -0
- package/dist/node_modules/@langchain/core/dist/runnables/base.d.ts +923 -0
- package/dist/node_modules/@langchain/core/dist/runnables/base.js +2377 -0
- package/dist/node_modules/@langchain/core/dist/runnables/branch.cjs +207 -0
- package/dist/node_modules/@langchain/core/dist/runnables/branch.d.ts +95 -0
- package/dist/node_modules/@langchain/core/dist/runnables/branch.js +203 -0
- package/dist/node_modules/@langchain/core/dist/runnables/config.cjs +223 -0
- package/dist/node_modules/@langchain/core/dist/runnables/config.d.ts +15 -0
- package/dist/node_modules/@langchain/core/dist/runnables/config.js +215 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph.cjs +270 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph.d.ts +44 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph.js +266 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.cjs +152 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.d.ts +18 -0
- package/dist/node_modules/@langchain/core/dist/runnables/graph_mermaid.js +147 -0
- package/dist/node_modules/@langchain/core/dist/runnables/history.cjs +262 -0
- package/dist/node_modules/@langchain/core/dist/runnables/history.d.ts +92 -0
- package/dist/node_modules/@langchain/core/dist/runnables/history.js +258 -0
- package/dist/node_modules/@langchain/core/dist/runnables/index.cjs +31 -0
- package/dist/node_modules/@langchain/core/dist/runnables/index.d.ts +7 -0
- package/dist/node_modules/@langchain/core/dist/runnables/index.js +6 -0
- package/dist/node_modules/@langchain/core/dist/runnables/iter.cjs +50 -0
- package/dist/node_modules/@langchain/core/dist/runnables/iter.d.ts +6 -0
- package/dist/node_modules/@langchain/core/dist/runnables/iter.js +42 -0
- package/dist/node_modules/@langchain/core/dist/runnables/passthrough.cjs +127 -0
- package/dist/node_modules/@langchain/core/dist/runnables/passthrough.d.ts +70 -0
- package/dist/node_modules/@langchain/core/dist/runnables/passthrough.js +123 -0
- package/dist/node_modules/@langchain/core/dist/runnables/remote.cjs +518 -0
- package/dist/node_modules/@langchain/core/dist/runnables/remote.d.ts +59 -0
- package/dist/node_modules/@langchain/core/dist/runnables/remote.js +514 -0
- package/dist/node_modules/@langchain/core/dist/runnables/router.cjs +97 -0
- package/dist/node_modules/@langchain/core/dist/runnables/router.d.ts +52 -0
- package/dist/node_modules/@langchain/core/dist/runnables/router.js +93 -0
- package/dist/node_modules/@langchain/core/dist/runnables/types.cjs +2 -0
- package/dist/node_modules/@langchain/core/dist/runnables/types.d.ts +68 -0
- package/dist/node_modules/@langchain/core/dist/runnables/types.js +1 -0
- package/dist/node_modules/@langchain/core/dist/runnables/utils.cjs +89 -0
- package/dist/node_modules/@langchain/core/dist/runnables/utils.d.ts +27 -0
- package/dist/node_modules/@langchain/core/dist/runnables/utils.js +84 -0
- package/dist/node_modules/@langchain/core/dist/runnables/wrappers.cjs +18 -0
- package/dist/node_modules/@langchain/core/dist/runnables/wrappers.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/runnables/wrappers.js +14 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/context.cjs +189 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/context.d.ts +155 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/context.js +182 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/globals.cjs +13 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/globals.d.ts +9 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/globals.js +8 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/index.cjs +69 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/index.d.ts +14 -0
- package/dist/node_modules/@langchain/core/dist/singletons/async_local_storage/index.js +65 -0
- package/dist/node_modules/@langchain/core/dist/singletons/callbacks.cjs +68 -0
- package/dist/node_modules/@langchain/core/dist/singletons/callbacks.d.ts +13 -0
- package/dist/node_modules/@langchain/core/dist/singletons/callbacks.js +59 -0
- package/dist/node_modules/@langchain/core/dist/singletons/index.cjs +8 -0
- package/dist/node_modules/@langchain/core/dist/singletons/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/dist/singletons/index.js +4 -0
- package/dist/node_modules/@langchain/core/dist/singletons/tracer.cjs +23 -0
- package/dist/node_modules/@langchain/core/dist/singletons/tracer.d.ts +3 -0
- package/dist/node_modules/@langchain/core/dist/singletons/tracer.js +18 -0
- package/dist/node_modules/@langchain/core/dist/stores.cjs +90 -0
- package/dist/node_modules/@langchain/core/dist/stores.d.ts +105 -0
- package/dist/node_modules/@langchain/core/dist/stores.js +85 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/base.cjs +139 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/base.d.ts +69 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/base.js +134 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/functional.cjs +236 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/functional.d.ts +93 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/functional.js +232 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/index.cjs +20 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/index.js +4 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/ir.cjs +141 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/ir.d.ts +138 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/ir.js +132 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/utils.cjs +104 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/utils.d.ts +33 -0
- package/dist/node_modules/@langchain/core/dist/structured_query/utils.js +94 -0
- package/dist/node_modules/@langchain/core/dist/tools/index.cjs +394 -0
- package/dist/node_modules/@langchain/core/dist/tools/index.d.ts +305 -0
- package/dist/node_modules/@langchain/core/dist/tools/index.js +385 -0
- package/dist/node_modules/@langchain/core/dist/tools/utils.cjs +28 -0
- package/dist/node_modules/@langchain/core/dist/tools/utils.d.ts +11 -0
- package/dist/node_modules/@langchain/core/dist/tools/utils.js +23 -0
- package/dist/node_modules/@langchain/core/dist/tracers/base.cjs +474 -0
- package/dist/node_modules/@langchain/core/dist/tracers/base.d.ts +259 -0
- package/dist/node_modules/@langchain/core/dist/tracers/base.js +469 -0
- package/dist/node_modules/@langchain/core/dist/tracers/console.cjs +233 -0
- package/dist/node_modules/@langchain/core/dist/tracers/console.d.ts +117 -0
- package/dist/node_modules/@langchain/core/dist/tracers/console.js +226 -0
- package/dist/node_modules/@langchain/core/dist/tracers/event_stream.cjs +533 -0
- package/dist/node_modules/@langchain/core/dist/tracers/event_stream.d.ts +140 -0
- package/dist/node_modules/@langchain/core/dist/tracers/event_stream.js +528 -0
- package/dist/node_modules/@langchain/core/dist/tracers/initialize.cjs +36 -0
- package/dist/node_modules/@langchain/core/dist/tracers/initialize.d.ts +20 -0
- package/dist/node_modules/@langchain/core/dist/tracers/initialize.js +31 -0
- package/dist/node_modules/@langchain/core/dist/tracers/log_stream.cjs +436 -0
- package/dist/node_modules/@langchain/core/dist/tracers/log_stream.d.ts +118 -0
- package/dist/node_modules/@langchain/core/dist/tracers/log_stream.js +429 -0
- package/dist/node_modules/@langchain/core/dist/tracers/root_listener.cjs +81 -0
- package/dist/node_modules/@langchain/core/dist/tracers/root_listener.d.ts +25 -0
- package/dist/node_modules/@langchain/core/dist/tracers/root_listener.js +77 -0
- package/dist/node_modules/@langchain/core/dist/tracers/run_collector.cjs +50 -0
- package/dist/node_modules/@langchain/core/dist/tracers/run_collector.d.ts +26 -0
- package/dist/node_modules/@langchain/core/dist/tracers/run_collector.js +46 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.cjs +160 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.d.ts +42 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain.js +156 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain_v1.cjs +200 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain_v1.d.ts +59 -0
- package/dist/node_modules/@langchain/core/dist/tracers/tracer_langchain_v1.js +196 -0
- package/dist/node_modules/@langchain/core/dist/types/_internal.cjs +2 -0
- package/dist/node_modules/@langchain/core/dist/types/_internal.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/types/_internal.js +1 -0
- package/dist/node_modules/@langchain/core/dist/types/stream.cjs +2 -0
- package/dist/node_modules/@langchain/core/dist/types/stream.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/types/stream.js +1 -0
- package/dist/node_modules/@langchain/core/dist/types/type-utils.cjs +2 -0
- package/dist/node_modules/@langchain/core/dist/types/type-utils.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/types/type-utils.js +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/async_caller.cjs +128 -0
- package/dist/node_modules/@langchain/core/dist/utils/async_caller.d.ts +45 -0
- package/dist/node_modules/@langchain/core/dist/utils/async_caller.js +121 -0
- package/dist/node_modules/@langchain/core/dist/utils/callbacks.cjs +17 -0
- package/dist/node_modules/@langchain/core/dist/utils/callbacks.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/callbacks.js +13 -0
- package/dist/node_modules/@langchain/core/dist/utils/chunk_array.cjs +11 -0
- package/dist/node_modules/@langchain/core/dist/utils/chunk_array.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/chunk_array.js +7 -0
- package/dist/node_modules/@langchain/core/dist/utils/env.cjs +79 -0
- package/dist/node_modules/@langchain/core/dist/utils/env.d.ts +24 -0
- package/dist/node_modules/@langchain/core/dist/utils/env.js +68 -0
- package/dist/node_modules/@langchain/core/dist/utils/event_source_parse.cjs +241 -0
- package/dist/node_modules/@langchain/core/dist/utils/event_source_parse.d.ts +39 -0
- package/dist/node_modules/@langchain/core/dist/utils/event_source_parse.js +234 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/index.cjs +49 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/index.d.ts +22 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/index.js +16 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.cjs +469 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.d.ts +111 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/core.js +459 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/duplex.cjs +237 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/duplex.d.ts +23 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/duplex.js +230 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.cjs +194 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.d.ts +36 -0
- package/dist/node_modules/@langchain/core/dist/utils/fast-json-patch/src/helpers.js +181 -0
- package/dist/node_modules/@langchain/core/dist/utils/function_calling.cjs +116 -0
- package/dist/node_modules/@langchain/core/dist/utils/function_calling.d.ts +66 -0
- package/dist/node_modules/@langchain/core/dist/utils/function_calling.js +107 -0
- package/dist/node_modules/@langchain/core/dist/utils/hash.cjs +5 -0
- package/dist/node_modules/@langchain/core/dist/utils/hash.d.ts +1 -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 +358 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/js-sha1/hash.js +355 -0
- package/dist/node_modules/@langchain/core/dist/utils/json.cjs +93 -0
- package/dist/node_modules/@langchain/core/dist/utils/json.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/utils/json.js +88 -0
- package/dist/node_modules/@langchain/core/dist/utils/json_patch.cjs +6 -0
- package/dist/node_modules/@langchain/core/dist/utils/json_patch.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/json_patch.js +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/json_schema.cjs +6 -0
- package/dist/node_modules/@langchain/core/dist/utils/json_schema.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/json_schema.js +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/math.cjs +127 -0
- package/dist/node_modules/@langchain/core/dist/utils/math.d.ts +40 -0
- package/dist/node_modules/@langchain/core/dist/utils/math.js +118 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/distances.cjs +18 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/distances.d.ts +8 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/distances.js +14 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/similarities.cjs +21 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/similarities.d.ts +7 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance/similarities.js +17 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance-euclidean/euclidean.cjs +15 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance-euclidean/euclidean.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/utils/ml-distance-euclidean/euclidean.js +10 -0
- package/dist/node_modules/@langchain/core/dist/utils/sax-js/sax.cjs +1558 -0
- package/dist/node_modules/@langchain/core/dist/utils/sax-js/sax.d.ts +2 -0
- package/dist/node_modules/@langchain/core/dist/utils/sax-js/sax.js +1555 -0
- package/dist/node_modules/@langchain/core/dist/utils/signal.cjs +30 -0
- package/dist/node_modules/@langchain/core/dist/utils/signal.d.ts +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/signal.js +26 -0
- package/dist/node_modules/@langchain/core/dist/utils/stream.cjs +274 -0
- package/dist/node_modules/@langchain/core/dist/utils/stream.d.ts +38 -0
- package/dist/node_modules/@langchain/core/dist/utils/stream.js +266 -0
- package/dist/node_modules/@langchain/core/dist/utils/testing/index.cjs +809 -0
- package/dist/node_modules/@langchain/core/dist/utils/testing/index.d.ts +326 -0
- package/dist/node_modules/@langchain/core/dist/utils/testing/index.js +790 -0
- package/dist/node_modules/@langchain/core/dist/utils/tiktoken.cjs +25 -0
- package/dist/node_modules/@langchain/core/dist/utils/tiktoken.d.ts +3 -0
- package/dist/node_modules/@langchain/core/dist/utils/tiktoken.js +20 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/index.cjs +17 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/index.d.ts +8 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/index.js +1 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.cjs +16 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.d.ts +8 -0
- package/dist/node_modules/@langchain/core/dist/utils/types/is_zod_schema.js +12 -0
- package/dist/node_modules/@langchain/core/dist/vectorstores.cjs +428 -0
- package/dist/node_modules/@langchain/core/dist/vectorstores.d.ts +644 -0
- package/dist/node_modules/@langchain/core/dist/vectorstores.js +422 -0
- package/dist/node_modules/@langchain/core/document_loaders/base.cjs +1 -0
- package/dist/node_modules/@langchain/core/document_loaders/base.d.cts +1 -0
- package/dist/node_modules/@langchain/core/document_loaders/base.d.ts +1 -0
- package/dist/node_modules/@langchain/core/document_loaders/base.js +1 -0
- package/dist/node_modules/@langchain/core/document_loaders/langsmith.cjs +1 -0
- package/dist/node_modules/@langchain/core/document_loaders/langsmith.d.cts +1 -0
- package/dist/node_modules/@langchain/core/document_loaders/langsmith.d.ts +1 -0
- package/dist/node_modules/@langchain/core/document_loaders/langsmith.js +1 -0
- package/dist/node_modules/@langchain/core/documents.cjs +1 -0
- package/dist/node_modules/@langchain/core/documents.d.cts +1 -0
- package/dist/node_modules/@langchain/core/documents.d.ts +1 -0
- package/dist/node_modules/@langchain/core/documents.js +1 -0
- package/dist/node_modules/@langchain/core/embeddings.cjs +1 -0
- package/dist/node_modules/@langchain/core/embeddings.d.cts +1 -0
- package/dist/node_modules/@langchain/core/embeddings.d.ts +1 -0
- package/dist/node_modules/@langchain/core/embeddings.js +1 -0
- package/dist/node_modules/@langchain/core/example_selectors.cjs +1 -0
- package/dist/node_modules/@langchain/core/example_selectors.d.cts +1 -0
- package/dist/node_modules/@langchain/core/example_selectors.d.ts +1 -0
- package/dist/node_modules/@langchain/core/example_selectors.js +1 -0
- package/dist/node_modules/@langchain/core/index.cjs +1 -0
- package/dist/node_modules/@langchain/core/index.d.cts +63 -0
- package/dist/node_modules/@langchain/core/index.d.ts +63 -0
- package/dist/node_modules/@langchain/core/index.js +63 -0
- package/dist/node_modules/@langchain/core/indexing.cjs +1 -0
- package/dist/node_modules/@langchain/core/indexing.d.cts +1 -0
- package/dist/node_modules/@langchain/core/indexing.d.ts +1 -0
- package/dist/node_modules/@langchain/core/indexing.js +1 -0
- package/dist/node_modules/@langchain/core/language_models/base.cjs +1 -0
- package/dist/node_modules/@langchain/core/language_models/base.d.cts +1 -0
- package/dist/node_modules/@langchain/core/language_models/base.d.ts +1 -0
- package/dist/node_modules/@langchain/core/language_models/base.js +1 -0
- package/dist/node_modules/@langchain/core/language_models/chat_models.cjs +1 -0
- package/dist/node_modules/@langchain/core/language_models/chat_models.d.cts +1 -0
- package/dist/node_modules/@langchain/core/language_models/chat_models.d.ts +1 -0
- package/dist/node_modules/@langchain/core/language_models/chat_models.js +1 -0
- package/dist/node_modules/@langchain/core/language_models/llms.cjs +1 -0
- package/dist/node_modules/@langchain/core/language_models/llms.d.cts +1 -0
- package/dist/node_modules/@langchain/core/language_models/llms.d.ts +1 -0
- package/dist/node_modules/@langchain/core/language_models/llms.js +1 -0
- package/dist/node_modules/@langchain/core/load/serializable.cjs +1 -0
- package/dist/node_modules/@langchain/core/load/serializable.d.cts +1 -0
- package/dist/node_modules/@langchain/core/load/serializable.d.ts +1 -0
- package/dist/node_modules/@langchain/core/load/serializable.js +1 -0
- package/dist/node_modules/@langchain/core/load.cjs +1 -0
- package/dist/node_modules/@langchain/core/load.d.cts +1 -0
- package/dist/node_modules/@langchain/core/load.d.ts +1 -0
- package/dist/node_modules/@langchain/core/load.js +1 -0
- package/dist/node_modules/@langchain/core/memory.cjs +1 -0
- package/dist/node_modules/@langchain/core/memory.d.cts +1 -0
- package/dist/node_modules/@langchain/core/memory.d.ts +1 -0
- package/dist/node_modules/@langchain/core/memory.js +1 -0
- package/dist/node_modules/@langchain/core/messages/tool.cjs +1 -0
- package/dist/node_modules/@langchain/core/messages/tool.d.cts +1 -0
- package/dist/node_modules/@langchain/core/messages/tool.d.ts +1 -0
- package/dist/node_modules/@langchain/core/messages/tool.js +1 -0
- package/dist/node_modules/@langchain/core/messages.cjs +1 -0
- package/dist/node_modules/@langchain/core/messages.d.cts +1 -0
- package/dist/node_modules/@langchain/core/messages.d.ts +1 -0
- package/dist/node_modules/@langchain/core/messages.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/README.md +75 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/deep-compare-strict.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/deep-compare-strict.js +42 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/dereference.d.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/dereference.js +147 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/format.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/format.js +111 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/index.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/index.js +24 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/pointer.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/pointer.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/types.d.ts +72 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/types.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/ucs2-length.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/ucs2-length.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/validate.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/validate.js +805 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/validator.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/commonjs/validator.js +27 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/deep-compare-strict.js +39 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/dereference.d.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/dereference.js +143 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/format.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/format.js +108 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/index.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/index.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/package.json +3 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/pointer.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/pointer.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/types.d.ts +72 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/types.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/ucs2-length.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/ucs2-length.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/validate.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/validate.js +802 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/validator.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/dist/esm/validator.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/package.json +68 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/deep-compare-strict.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/deep-compare-strict.ts +39 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/dereference.d.ts +12 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/dereference.ts +188 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/format.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/format.ts +164 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/index.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/index.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/pointer.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/pointer.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/types.d.ts +79 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/types.ts +92 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/ucs2-length.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/ucs2-length.ts +24 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/validate.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/validate.ts +1168 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/validator.d.ts +14 -0
- package/dist/node_modules/@langchain/core/node_modules/@cfworker/json-schema/src/validator.ts +32 -0
- package/dist/node_modules/@langchain/core/node_modules/ansi-styles/index.d.ts +167 -0
- package/dist/node_modules/@langchain/core/node_modules/ansi-styles/index.js +164 -0
- package/dist/node_modules/@langchain/core/node_modules/ansi-styles/license +9 -0
- package/dist/node_modules/@langchain/core/node_modules/ansi-styles/package.json +52 -0
- package/dist/node_modules/@langchain/core/node_modules/camelcase/index.d.ts +103 -0
- package/dist/node_modules/@langchain/core/node_modules/camelcase/index.js +113 -0
- package/dist/node_modules/@langchain/core/node_modules/camelcase/license +9 -0
- package/dist/node_modules/@langchain/core/node_modules/camelcase/package.json +44 -0
- package/dist/node_modules/@langchain/core/node_modules/decamelize/index.js +13 -0
- package/dist/node_modules/@langchain/core/node_modules/decamelize/license +21 -0
- package/dist/node_modules/@langchain/core/node_modules/decamelize/package.json +38 -0
- package/dist/node_modules/@langchain/core/node_modules/decamelize/readme.md +48 -0
- package/dist/node_modules/@langchain/core/node_modules/js-tiktoken/lite.cjs +256 -0
- package/dist/node_modules/@langchain/core/node_modules/js-tiktoken/lite.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/js-tiktoken/lite.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/README.md +523 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/anonymizer.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/anonymizer.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/anonymizer.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/anonymizer.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/client.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/client.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/client.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/client.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/anonymizer/index.cjs +102 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/anonymizer/index.d.ts +16 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/anonymizer/index.js +95 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.cjs +3266 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.d.ts +899 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/client.js +3237 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/env.cjs +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/env.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/env.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_random_name.cjs +730 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_random_name.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_random_name.js +726 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_runner.cjs +869 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_runner.d.ts +236 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/_runner.js +864 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.cjs +219 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.d.ts +61 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluate_comparative.js +212 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluator.cjs +112 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluator.d.ts +105 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/evaluator.js +107 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/index.cjs +9 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/index.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/langchain.cjs +55 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/langchain.d.ts +21 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/langchain.js +51 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/string_evaluator.cjs +66 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/string_evaluator.d.ts +30 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/evaluation/string_evaluator.js +62 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.cjs +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/index.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.cjs +44 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.d.ts +437 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/index.js +322 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/reporter.cjs +37 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/reporter.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/jest/reporter.js +35 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.cjs +139 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.d.ts +30 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/langchain.js +134 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.cjs +586 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.d.ts +112 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/run_trees.js +556 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/schemas.cjs +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/schemas.d.ts +530 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/schemas.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/constants.cjs +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/constants.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/constants.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.cjs +27 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.d.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/fetch.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.cjs +61 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.d.ts +22 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/traceable.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.cjs +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.d.ts +40 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/singletons/types.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.cjs +554 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.d.ts +57 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/traceable.js +546 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_git.cjs +72 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_git.d.ts +14 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_git.js +67 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.cjs +37 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/_uuid.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/asserts.cjs +47 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/asserts.d.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/asserts.js +37 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.cjs +139 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.d.ts +41 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/async_caller.js +132 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/atee.cjs +24 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/atee.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/atee.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.cjs +234 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.d.ts +61 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/env.js +217 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.cjs +89 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.d.ts +44 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/error.js +83 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.cjs +235 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/fast-safe-stringify/index.js +231 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/constants.cjs +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/constants.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/constants.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/globals.cjs +40 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/globals.d.ts +34 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/globals.js +35 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.cjs +591 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.d.ts +95 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/index.js +553 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/matchers.cjs +104 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/matchers.d.ts +27 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/matchers.js +98 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/reporter.cjs +286 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/reporter.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/reporter.js +256 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/types.cjs +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/types.d.ts +28 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/types.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/chain.cjs +93 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/chain.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/chain.js +89 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/evaluatedBy.cjs +90 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/evaluatedBy.d.ts +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/jestlike/vendor/evaluatedBy.js +85 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/assignValue.cjs +29 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/assignValue.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/assignValue.js +24 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/baseAssignValue.cjs +25 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/baseAssignValue.d.ts +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/baseAssignValue.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/baseSet.cjs +50 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/baseSet.d.ts +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/baseSet.js +45 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/castPath.cjs +22 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/castPath.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/castPath.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/eq.cjs +36 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/eq.d.ts +32 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/eq.js +34 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/getTag.cjs +18 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/getTag.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/getTag.js +16 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isIndex.cjs +25 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isIndex.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isIndex.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isKey.cjs +34 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isKey.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isKey.js +29 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isObject.cjs +31 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isObject.d.ts +25 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isObject.js +29 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isSymbol.cjs +28 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isSymbol.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/isSymbol.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/memoizeCapped.cjs +65 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/memoizeCapped.d.ts +50 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/memoizeCapped.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/set.cjs +41 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/set.d.ts +32 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/set.js +36 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/stringToPath.cjs +49 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/stringToPath.d.ts +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/stringToPath.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/toKey.cjs +24 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/toKey.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/lodash/toKey.js +19 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/messages.cjs +22 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/messages.d.ts +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/messages.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/prompts.cjs +38 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/prompts.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/prompts.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/shuffle.cjs +15 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/shuffle.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/shuffle.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/warn.cjs +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/warn.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/utils/warn.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.cjs +673 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.d.ts +75 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.js +669 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.types.cjs +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.types.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vercel.types.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.cjs +44 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.d.ts +435 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/index.js +322 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.cjs +29 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/vitest/reporter.js +27 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/generic.cjs +49 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/generic.d.ts +21 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/generic.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/index.cjs +20 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/index.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.cjs +286 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.d.ts +78 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/openai.js +282 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.cjs +100 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.d.ts +30 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/dist/wrappers/vercel.js +96 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation/langchain.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation/langchain.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation/langchain.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation/langchain.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/evaluation.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/index.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/index.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest/reporter.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest/reporter.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest/reporter.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest/reporter.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/jest.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/langchain.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/langchain.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/langchain.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/langchain.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/LICENSE +15 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/README.md +654 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/bin/semver.js +188 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/classes/comparator.js +141 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/classes/index.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/classes/range.js +554 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/classes/semver.js +302 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/clean.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/cmp.js +52 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/coerce.js +60 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/compare-build.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/compare-loose.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/compare.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/diff.js +65 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/eq.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/gt.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/gte.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/inc.js +19 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/lt.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/lte.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/major.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/minor.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/neq.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/parse.js +16 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/patch.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/prerelease.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/rcompare.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/rsort.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/satisfies.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/sort.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/functions/valid.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/index.js +89 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/internal/constants.js +35 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/internal/debug.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/internal/identifiers.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/internal/lrucache.js +40 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/internal/parse-options.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/internal/re.js +217 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/package.json +77 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/preload.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/range.bnf +16 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/gtr.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/intersects.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/ltr.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/max-satisfying.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/min-satisfying.js +24 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/min-version.js +61 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/outside.js +80 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/simplify.js +47 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/subset.js +247 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/to-comparators.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/semver/ranges/valid.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/CHANGELOG.md +292 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/CONTRIBUTING.md +18 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/LICENSE.md +9 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/README.md +584 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/bin/uuid +2 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/index.js +104 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/max.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/md5.js +200 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/native.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/nil.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/parse.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/regex.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/rng.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/sha1.js +82 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/stringify.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v1.js +131 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v1ToV6.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v3.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v35.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v4.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v5.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v6.js +42 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v6ToV1.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/v7.js +152 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/validate.js +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/commonjs-browser/version.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/index.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/max.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/md5.js +194 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/parse.js +37 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/rng.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/sha1.js +76 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/stringify.js +31 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v1.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v1ToV6.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v35.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v4.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v6.js +36 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v6ToV1.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/v7.js +146 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/validate.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-browser/version.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/index.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/max.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/md5.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/parse.js +37 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/rng.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/sha1.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/stringify.js +31 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v1.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v1ToV6.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v35.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v4.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v6.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v6ToV1.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/v7.js +146 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/validate.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/esm-node/version.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/index.js +104 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/max.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/md5-browser.js +200 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/md5.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/native-browser.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/native.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/nil.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/parse.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/regex.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/rng-browser.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/rng.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/sha1-browser.js +82 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/sha1.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/stringify.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/uuid-bin.js +75 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v1.js +131 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v1ToV6.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v3.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v35.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v4.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v5.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v6.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v6ToV1.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/v7.js +152 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/validate.js +12 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/dist/version.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/package.json +142 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/node_modules/uuid/wrapper.mjs +15 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/package.json +360 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/run_trees.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/run_trees.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/run_trees.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/run_trees.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/schemas.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/schemas.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/schemas.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/schemas.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/singletons/traceable.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/singletons/traceable.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/singletons/traceable.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/singletons/traceable.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/traceable.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/traceable.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/traceable.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/traceable.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/utils/jestlike.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/utils/jestlike.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/utils/jestlike.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/utils/jestlike.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vercel.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vercel.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vercel.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vercel.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest/reporter.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/vitest.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/openai.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/openai.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/openai.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/openai.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/vercel.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/vercel.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/vercel.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers/vercel.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers.cjs +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers.d.cts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/langsmith/wrappers.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/CHANGELOG.md +618 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/LICENSE +11 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/README.md +621 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/bin/mustache +150 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/mustache.js +772 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/mustache.min.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/mustache.mjs +764 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/package.json +67 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/dojo/mustache.js.post +4 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/dojo/mustache.js.pre +9 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/jquery/mustache.js.post +13 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/jquery/mustache.js.pre +9 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/mootools/mustache.js.post +5 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/mootools/mustache.js.pre +2 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/qooxdoo/mustache.js.post +9 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/qooxdoo/mustache.js.pre +172 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/yui3/mustache.js.post +4 -0
- package/dist/node_modules/@langchain/core/node_modules/mustache/wrappers/yui3/mustache.js.pre +1 -0
- package/dist/node_modules/@langchain/core/node_modules/p-finally/index.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/p-finally/license +21 -0
- package/dist/node_modules/@langchain/core/node_modules/p-finally/package.json +42 -0
- package/dist/node_modules/@langchain/core/node_modules/p-finally/readme.md +47 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/index.d.ts +101 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/index.js +279 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/lower-bound.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/lower-bound.js +21 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/options.d.ts +64 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/options.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/priority-queue.d.ts +12 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/priority-queue.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/queue.d.ts +7 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/dist/queue.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/license +9 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/LICENSE +21 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/README.md +94 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/index.d.ts +134 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/index.js +336 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/package.json +56 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.js +340 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.min.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/node_modules/eventemitter3/umd/eventemitter3.min.js.map +1 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/package.json +92 -0
- package/dist/node_modules/@langchain/core/node_modules/p-queue/readme.md +400 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/index.d.ts +106 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/index.js +85 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/license +9 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/License +21 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/README.md +227 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/example/dns.js +31 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/example/stop.js +40 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/index.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/lib/retry.js +100 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/lib/retry_operation.js +162 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/node_modules/retry/package.json +36 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/package.json +51 -0
- package/dist/node_modules/@langchain/core/node_modules/p-retry/readme.md +148 -0
- package/dist/node_modules/@langchain/core/node_modules/p-timeout/index.d.ts +72 -0
- package/dist/node_modules/@langchain/core/node_modules/p-timeout/index.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/p-timeout/license +9 -0
- package/dist/node_modules/@langchain/core/node_modules/p-timeout/package.json +45 -0
- package/dist/node_modules/@langchain/core/node_modules/p-timeout/readme.md +87 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/bin/uuid +2 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/index.js +104 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/max.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/md5.js +200 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/native.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/nil.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/parse.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/regex.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/rng.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/sha1.js +82 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/stringify.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v1.js +131 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v1ToV6.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v3.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v35.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v4.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v5.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v6.js +42 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v6ToV1.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/v7.js +152 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/validate.js +12 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/commonjs-browser/version.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/index.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/max.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/md5.js +194 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/native.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/nil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/parse.js +37 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/regex.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/rng.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/sha1.js +76 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/stringify.js +31 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v1.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v1ToV6.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v3.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v35.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v4.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v5.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v6.js +36 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v6ToV1.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/v7.js +146 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/validate.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-browser/version.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/index.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/max.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/md5.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/native.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/nil.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/parse.js +37 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/regex.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/rng.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/sha1.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/stringify.js +31 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v1.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v1ToV6.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v3.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v35.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v4.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v5.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v6.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v6ToV1.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/v7.js +146 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/validate.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/esm-node/version.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/index.js +104 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/max.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/md5-browser.js +200 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/md5.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/native-browser.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/native.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/nil.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/parse.js +44 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/regex.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/rng-browser.js +23 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/rng.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/sha1-browser.js +82 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/sha1.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/stringify.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/uuid-bin.js +75 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v1.js +131 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v1ToV6.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v3.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v35.js +63 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v4.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v5.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v6.js +38 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v6ToV1.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/v7.js +152 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/validate.js +12 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/dist/version.js +15 -0
- package/dist/node_modules/@langchain/core/node_modules/uuid/package.json +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/LICENSE +21 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/README.md +3074 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/ZodError.d.ts +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/ZodError.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/__tests__/Mocker.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/datetime.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/datetime.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/discriminatedUnion.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/index.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/ipv4.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/ipv4.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/object.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/object.js +70 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/primitives.js +170 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/realworld.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/string.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/string.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/union.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/benchmarks/union.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/errors.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/errors.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/external.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/external.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/enumUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/errorUtil.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/parseUtil.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/partialUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/typeAliases.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/util.d.ts +82 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/helpers/util.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/index.mjs +4405 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/index.umd.js +4520 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/locales/en.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/locales/en.js +129 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/standard-schema.d.ts +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/types.d.ts +1062 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/lib/types.js +3846 -0
- package/dist/node_modules/@langchain/core/node_modules/zod/package.json +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/.github/CR_logotype-full-color.png +0 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/.github/FUNDING.yml +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/.prettierrc.json +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/LICENSE +15 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/README.md +371 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/SECURITY.md +12 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/changelog.md +77 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/contributing.md +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/createIndex.ts +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/Options.js +48 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/Refs.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/errorMessages.js +19 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/index.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/package.json +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parseDef.js +72 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parseTypes.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/any.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/array.js +30 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/bigint.js +53 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/boolean.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/branded.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/catch.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/date.js +50 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/default.js +11 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/effects.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/enum.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/intersection.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/literal.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/map.js +29 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/nativeEnum.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/never.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/null.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/nullable.js +37 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/number.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/object.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/optional.js +24 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/pipeline.js +24 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/promise.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/readonly.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/record.js +64 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/set.js +24 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/string.js +357 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/tuple.js +36 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/undefined.js +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/union.js +84 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/parsers/unknown.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/selectParser.js +110 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/cjs/zodToJsonSchema.js +69 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/Options.js +43 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/Refs.js +21 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +14 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/index.js +39 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/package.json +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parseDef.js +68 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parseTypes.js +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +26 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +49 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +46 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +7 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +52 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +21 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +25 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +16 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +52 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +60 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +20 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +353 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +80 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/selectParser.js +106 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +66 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/Options.d.ts +34 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/Refs.d.ts +14 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/errorMessages.d.ts +11 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/index.d.ts +39 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parseDef.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parseTypes.d.ts +34 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/any.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/array.d.ts +12 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/bigint.d.ts +14 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/boolean.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/branded.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/catch.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/date.d.ts +15 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/default.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/effects.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/enum.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/intersection.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/literal.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/map.d.ts +15 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/nativeEnum.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/never.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/null.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/nullable.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/number.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/object.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/optional.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/pipeline.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/promise.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/readonly.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/record.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/set.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/string.d.ts +73 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/tuple.d.ts +13 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/undefined.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/union.d.ts +23 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/parsers/unknown.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/selectParser.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist/types/zodToJsonSchema.d.ts +10 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/index.js +12 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/.package-lock.json +26 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/LICENSE +21 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/README.md +3074 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/ZodError.d.ts +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/ZodError.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/__tests__/Mocker.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/datetime.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/datetime.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/discriminatedUnion.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/index.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/ipv4.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/ipv4.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/object.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/object.js +70 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/primitives.js +170 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/realworld.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/string.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/string.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/union.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/benchmarks/union.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/errors.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/errors.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/external.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/external.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/enumUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/errorUtil.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/parseUtil.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/partialUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/typeAliases.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/util.d.ts +82 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/helpers/util.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/index.mjs +4405 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/index.umd.js +4520 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/locales/en.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/locales/en.js +129 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/standard-schema.d.ts +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/types.d.ts +1062 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/lib/types.js +3846 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/node_modules/zod/package.json +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/package-lock.json +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/cjs/package.json +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/index.js +12 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/.package-lock.json +26 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/LICENSE +21 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/README.md +3074 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/ZodError.d.ts +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/ZodError.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/__tests__/Mocker.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/datetime.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/datetime.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/discriminatedUnion.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/index.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/ipv4.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/ipv4.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/object.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/object.js +70 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/primitives.js +170 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/realworld.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/string.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/string.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/union.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/benchmarks/union.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/errors.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/errors.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/external.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/external.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/enumUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/errorUtil.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/parseUtil.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/partialUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/typeAliases.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/util.d.ts +82 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/helpers/util.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/index.mjs +4405 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/index.umd.js +4520 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/locales/en.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/locales/en.js +129 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/standard-schema.d.ts +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/types.d.ts +1062 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/lib/types.js +3846 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/node_modules/zod/package.json +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/package-lock.json +32 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/esm/package.json +11 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/package.json +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/index.ts +14 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/.package-lock.json +29 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/LICENSE +21 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/README.md +3074 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/index.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/ZodError.d.ts +164 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/ZodError.js +137 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/__tests__/Mocker.d.ts +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/__tests__/Mocker.js +57 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/datetime.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/datetime.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/discriminatedUnion.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/discriminatedUnion.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/index.d.ts +1 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/index.js +59 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/ipv4.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/ipv4.js +54 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/object.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/object.js +70 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/primitives.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/primitives.js +170 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/realworld.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/realworld.js +56 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/string.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/string.js +55 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/union.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/benchmarks/union.js +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/errors.d.ts +5 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/errors.js +17 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/external.d.ts +6 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/external.js +22 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/enumUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/enumUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/errorUtil.d.ts +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/errorUtil.js +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/parseUtil.d.ts +78 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/parseUtil.js +125 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/partialUtil.d.ts +8 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/partialUtil.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/typeAliases.d.ts +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/typeAliases.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/util.d.ts +82 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/helpers/util.js +142 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/index.d.ts +4 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/index.js +33 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/index.mjs +4405 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/index.umd.js +4520 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/locales/en.d.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/locales/en.js +129 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/standard-schema.d.ts +102 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/standard-schema.js +2 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/types.d.ts +1062 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/lib/types.js +3846 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/node_modules/zod/package.json +122 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/package-lock.json +35 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/dist-test/types/package.json +9 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/package.json +79 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/postcjs.ts +3 -0
- package/dist/node_modules/@langchain/core/node_modules/zod-to-json-schema/postesm.ts +3 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_functions.cjs +1 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_functions.d.cts +1 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_functions.d.ts +1 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_functions.js +1 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_tools.cjs +1 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_tools.d.cts +1 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_tools.d.ts +1 -0
- package/dist/node_modules/@langchain/core/output_parsers/openai_tools.js +1 -0
- package/dist/node_modules/@langchain/core/output_parsers.cjs +1 -0
- package/dist/node_modules/@langchain/core/output_parsers.d.cts +1 -0
- package/dist/node_modules/@langchain/core/output_parsers.d.ts +1 -0
- package/dist/node_modules/@langchain/core/output_parsers.js +1 -0
- package/dist/node_modules/@langchain/core/outputs.cjs +1 -0
- package/dist/node_modules/@langchain/core/outputs.d.cts +1 -0
- package/dist/node_modules/@langchain/core/outputs.d.ts +1 -0
- package/dist/node_modules/@langchain/core/outputs.js +1 -0
- package/dist/node_modules/@langchain/core/package.json +1 -0
- package/dist/node_modules/@langchain/core/prompt_values.cjs +1 -0
- package/dist/node_modules/@langchain/core/prompt_values.d.cts +1 -0
- package/dist/node_modules/@langchain/core/prompt_values.d.ts +1 -0
- package/dist/node_modules/@langchain/core/prompt_values.js +1 -0
- package/dist/node_modules/@langchain/core/prompts.cjs +1 -0
- package/dist/node_modules/@langchain/core/prompts.d.cts +1 -0
- package/dist/node_modules/@langchain/core/prompts.d.ts +1 -0
- package/dist/node_modules/@langchain/core/prompts.js +1 -0
- package/dist/node_modules/@langchain/core/retrievers/document_compressors.cjs +1 -0
- package/dist/node_modules/@langchain/core/retrievers/document_compressors.d.cts +1 -0
- package/dist/node_modules/@langchain/core/retrievers/document_compressors.d.ts +1 -0
- package/dist/node_modules/@langchain/core/retrievers/document_compressors.js +1 -0
- package/dist/node_modules/@langchain/core/retrievers.cjs +1 -0
- package/dist/node_modules/@langchain/core/retrievers.d.cts +1 -0
- package/dist/node_modules/@langchain/core/retrievers.d.ts +1 -0
- package/dist/node_modules/@langchain/core/retrievers.js +1 -0
- package/dist/node_modules/@langchain/core/runnables/graph.cjs +1 -0
- package/dist/node_modules/@langchain/core/runnables/graph.d.cts +1 -0
- package/dist/node_modules/@langchain/core/runnables/graph.d.ts +1 -0
- package/dist/node_modules/@langchain/core/runnables/graph.js +1 -0
- package/dist/node_modules/@langchain/core/runnables/remote.cjs +1 -0
- package/dist/node_modules/@langchain/core/runnables/remote.d.cts +1 -0
- package/dist/node_modules/@langchain/core/runnables/remote.d.ts +1 -0
- package/dist/node_modules/@langchain/core/runnables/remote.js +1 -0
- package/dist/node_modules/@langchain/core/runnables.cjs +1 -0
- package/dist/node_modules/@langchain/core/runnables.d.cts +1 -0
- package/dist/node_modules/@langchain/core/runnables.d.ts +1 -0
- package/dist/node_modules/@langchain/core/runnables.js +1 -0
- package/dist/node_modules/@langchain/core/singletons.cjs +1 -0
- package/dist/node_modules/@langchain/core/singletons.d.cts +1 -0
- package/dist/node_modules/@langchain/core/singletons.d.ts +1 -0
- package/dist/node_modules/@langchain/core/singletons.js +1 -0
- package/dist/node_modules/@langchain/core/stores.cjs +1 -0
- package/dist/node_modules/@langchain/core/stores.d.cts +1 -0
- package/dist/node_modules/@langchain/core/stores.d.ts +1 -0
- package/dist/node_modules/@langchain/core/stores.js +1 -0
- package/dist/node_modules/@langchain/core/structured_query.cjs +1 -0
- package/dist/node_modules/@langchain/core/structured_query.d.cts +1 -0
- package/dist/node_modules/@langchain/core/structured_query.d.ts +1 -0
- package/dist/node_modules/@langchain/core/structured_query.js +1 -0
- package/dist/node_modules/@langchain/core/tools.cjs +1 -0
- package/dist/node_modules/@langchain/core/tools.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tools.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tools.js +1 -0
- package/dist/node_modules/@langchain/core/tracers/base.cjs +1 -0
- package/dist/node_modules/@langchain/core/tracers/base.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tracers/base.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tracers/base.js +1 -0
- package/dist/node_modules/@langchain/core/tracers/console.cjs +1 -0
- package/dist/node_modules/@langchain/core/tracers/console.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tracers/console.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tracers/console.js +1 -0
- package/dist/node_modules/@langchain/core/tracers/initialize.cjs +1 -0
- package/dist/node_modules/@langchain/core/tracers/initialize.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tracers/initialize.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tracers/initialize.js +1 -0
- package/dist/node_modules/@langchain/core/tracers/log_stream.cjs +1 -0
- package/dist/node_modules/@langchain/core/tracers/log_stream.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tracers/log_stream.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tracers/log_stream.js +1 -0
- package/dist/node_modules/@langchain/core/tracers/run_collector.cjs +1 -0
- package/dist/node_modules/@langchain/core/tracers/run_collector.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tracers/run_collector.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tracers/run_collector.js +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain.cjs +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain.js +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain_v1.cjs +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain_v1.d.cts +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain_v1.d.ts +1 -0
- package/dist/node_modules/@langchain/core/tracers/tracer_langchain_v1.js +1 -0
- package/dist/node_modules/@langchain/core/types/stream.cjs +1 -0
- package/dist/node_modules/@langchain/core/types/stream.d.cts +1 -0
- package/dist/node_modules/@langchain/core/types/stream.d.ts +1 -0
- package/dist/node_modules/@langchain/core/types/stream.js +1 -0
- package/dist/node_modules/@langchain/core/utils/async_caller.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/async_caller.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/async_caller.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/async_caller.js +1 -0
- package/dist/node_modules/@langchain/core/utils/chunk_array.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/chunk_array.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/chunk_array.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/chunk_array.js +1 -0
- package/dist/node_modules/@langchain/core/utils/env.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/env.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/env.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/env.js +1 -0
- package/dist/node_modules/@langchain/core/utils/event_source_parse.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/event_source_parse.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/event_source_parse.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/event_source_parse.js +1 -0
- package/dist/node_modules/@langchain/core/utils/function_calling.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/function_calling.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/function_calling.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/function_calling.js +1 -0
- package/dist/node_modules/@langchain/core/utils/hash.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/hash.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/hash.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/hash.js +1 -0
- package/dist/node_modules/@langchain/core/utils/json_patch.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/json_patch.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/json_patch.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/json_patch.js +1 -0
- package/dist/node_modules/@langchain/core/utils/json_schema.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/json_schema.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/json_schema.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/json_schema.js +1 -0
- package/dist/node_modules/@langchain/core/utils/math.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/math.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/math.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/math.js +1 -0
- package/dist/node_modules/@langchain/core/utils/stream.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/stream.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/stream.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/stream.js +1 -0
- package/dist/node_modules/@langchain/core/utils/testing.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/testing.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/testing.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/testing.js +1 -0
- package/dist/node_modules/@langchain/core/utils/tiktoken.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/tiktoken.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/tiktoken.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/tiktoken.js +1 -0
- package/dist/node_modules/@langchain/core/utils/types.cjs +1 -0
- package/dist/node_modules/@langchain/core/utils/types.d.cts +1 -0
- package/dist/node_modules/@langchain/core/utils/types.d.ts +1 -0
- package/dist/node_modules/@langchain/core/utils/types.js +1 -0
- package/dist/node_modules/@langchain/core/vectorstores.cjs +1 -0
- package/dist/node_modules/@langchain/core/vectorstores.d.cts +1 -0
- package/dist/node_modules/@langchain/core/vectorstores.d.ts +1 -0
- package/dist/node_modules/@langchain/core/vectorstores.js +1 -0
- package/dist/node_modules/@langchain/deepseek/LICENSE +21 -0
- package/dist/node_modules/@langchain/deepseek/dist/chat_models.cjs +417 -0
- package/dist/node_modules/@langchain/deepseek/dist/chat_models.d.ts +414 -0
- package/dist/node_modules/@langchain/deepseek/dist/chat_models.js +413 -0
- package/dist/node_modules/@langchain/deepseek/dist/index.cjs +17 -0
- package/dist/node_modules/@langchain/deepseek/dist/index.d.ts +1 -0
- package/dist/node_modules/@langchain/deepseek/dist/index.js +1 -0
- package/dist/node_modules/@langchain/deepseek/index.cjs +37 -0
- package/dist/node_modules/@langchain/deepseek/index.d.cts +1 -0
- package/dist/node_modules/@langchain/deepseek/index.d.ts +1 -0
- package/dist/node_modules/@langchain/deepseek/index.js +1 -0
- package/dist/node_modules/@langchain/deepseek/package.json +1 -0
- package/dist/node_modules/@langchain/openai/LICENSE +21 -0
- package/dist/node_modules/@langchain/openai/dist/azure/chat_models.cjs +647 -0
- package/dist/node_modules/@langchain/openai/dist/azure/chat_models.d.ts +456 -0
- package/dist/node_modules/@langchain/openai/dist/azure/chat_models.js +643 -0
- package/dist/node_modules/@langchain/openai/dist/azure/embeddings.cjs +129 -0
- package/dist/node_modules/@langchain/openai/dist/azure/embeddings.d.ts +22 -0
- package/dist/node_modules/@langchain/openai/dist/azure/embeddings.js +125 -0
- package/dist/node_modules/@langchain/openai/dist/azure/llms.cjs +167 -0
- package/dist/node_modules/@langchain/openai/dist/azure/llms.d.ts +27 -0
- package/dist/node_modules/@langchain/openai/dist/azure/llms.js +163 -0
- package/dist/node_modules/@langchain/openai/dist/chat_models.cjs +1769 -0
- package/dist/node_modules/@langchain/openai/dist/chat_models.d.ts +759 -0
- package/dist/node_modules/@langchain/openai/dist/chat_models.js +1763 -0
- package/dist/node_modules/@langchain/openai/dist/embeddings.cjs +195 -0
- package/dist/node_modules/@langchain/openai/dist/embeddings.d.ts +104 -0
- package/dist/node_modules/@langchain/openai/dist/embeddings.js +191 -0
- package/dist/node_modules/@langchain/openai/dist/index.cjs +32 -0
- package/dist/node_modules/@langchain/openai/dist/index.d.ts +12 -0
- package/dist/node_modules/@langchain/openai/dist/index.js +12 -0
- package/dist/node_modules/@langchain/openai/dist/llms.cjs +470 -0
- package/dist/node_modules/@langchain/openai/dist/llms.d.ts +117 -0
- package/dist/node_modules/@langchain/openai/dist/llms.js +466 -0
- package/dist/node_modules/@langchain/openai/dist/tools/dalle.cjs +193 -0
- package/dist/node_modules/@langchain/openai/dist/tools/dalle.d.ts +111 -0
- package/dist/node_modules/@langchain/openai/dist/tools/dalle.js +189 -0
- package/dist/node_modules/@langchain/openai/dist/tools/index.cjs +17 -0
- package/dist/node_modules/@langchain/openai/dist/tools/index.d.ts +1 -0
- package/dist/node_modules/@langchain/openai/dist/tools/index.js +1 -0
- package/dist/node_modules/@langchain/openai/dist/types.cjs +2 -0
- package/dist/node_modules/@langchain/openai/dist/types.d.ts +218 -0
- package/dist/node_modules/@langchain/openai/dist/types.js +1 -0
- package/dist/node_modules/@langchain/openai/dist/utils/azure.cjs +51 -0
- package/dist/node_modules/@langchain/openai/dist/utils/azure.d.ts +34 -0
- package/dist/node_modules/@langchain/openai/dist/utils/azure.js +47 -0
- package/dist/node_modules/@langchain/openai/dist/utils/errors.cjs +11 -0
- package/dist/node_modules/@langchain/openai/dist/utils/errors.d.ts +2 -0
- package/dist/node_modules/@langchain/openai/dist/utils/errors.js +7 -0
- package/dist/node_modules/@langchain/openai/dist/utils/openai-format-fndef.cjs +81 -0
- package/dist/node_modules/@langchain/openai/dist/utils/openai-format-fndef.d.ts +44 -0
- package/dist/node_modules/@langchain/openai/dist/utils/openai-format-fndef.js +77 -0
- package/dist/node_modules/@langchain/openai/dist/utils/openai.cjs +75 -0
- package/dist/node_modules/@langchain/openai/dist/utils/openai.d.ts +20 -0
- package/dist/node_modules/@langchain/openai/dist/utils/openai.js +68 -0
- package/dist/node_modules/@langchain/openai/dist/utils/prompts.cjs +42 -0
- package/dist/node_modules/@langchain/openai/dist/utils/prompts.d.ts +36 -0
- package/dist/node_modules/@langchain/openai/dist/utils/prompts.js +38 -0
- package/dist/node_modules/@langchain/openai/dist/utils/tools.cjs +54 -0
- package/dist/node_modules/@langchain/openai/dist/utils/tools.d.ts +20 -0
- package/dist/node_modules/@langchain/openai/dist/utils/tools.js +50 -0
- package/dist/node_modules/@langchain/openai/index.cjs +37 -0
- package/dist/node_modules/@langchain/openai/index.d.cts +1 -0
- package/dist/node_modules/@langchain/openai/index.d.ts +1 -0
- package/dist/node_modules/@langchain/openai/index.js +1 -0
- package/dist/node_modules/@langchain/openai/package.json +1 -0
- package/dist/server/collections/llm-services.d.ts +10 -0
- package/dist/server/collections/llm-services.js +48 -0
- package/dist/server/index.d.ts +11 -0
- package/dist/server/index.js +51 -0
- package/dist/server/llm-providers/deepseek.d.ts +16 -0
- package/dist/server/llm-providers/deepseek.js +64 -0
- package/dist/server/llm-providers/handlers/parse-messages.d.ts +9 -0
- package/dist/server/llm-providers/handlers/parse-messages.js +70 -0
- package/dist/server/llm-providers/openai.d.ts +18 -0
- package/dist/server/llm-providers/openai.js +69 -0
- package/dist/server/llm-providers/provider.d.ts +36 -0
- package/dist/server/llm-providers/provider.js +104 -0
- package/dist/server/manager/ai-manager.d.ts +26 -0
- package/dist/server/manager/ai-manager.js +45 -0
- package/dist/server/plugin.d.ts +21 -0
- package/dist/server/plugin.js +83 -0
- package/dist/server/resource/ai.d.ts +11 -0
- package/dist/server/resource/ai.js +71 -0
- package/dist/server/workflow/nodes/llm/index.d.ts +15 -0
- package/dist/server/workflow/nodes/llm/index.js +127 -0
- package/package.json +21 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,3266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.Client = exports.DEFAULT_BATCH_SIZE_LIMIT_BYTES = exports.AutoBatchQueue = exports.mergeRuntimeEnvIntoRunCreate = void 0;
|
|
27
|
+
const uuid = __importStar(require("uuid"));
|
|
28
|
+
const async_caller_js_1 = require("./utils/async_caller.cjs");
|
|
29
|
+
const messages_js_1 = require("./utils/messages.cjs");
|
|
30
|
+
const env_js_1 = require("./utils/env.cjs");
|
|
31
|
+
const index_js_1 = require("./index.cjs");
|
|
32
|
+
const _uuid_js_1 = require("./utils/_uuid.cjs");
|
|
33
|
+
const warn_js_1 = require("./utils/warn.cjs");
|
|
34
|
+
const prompts_js_1 = require("./utils/prompts.cjs");
|
|
35
|
+
const error_js_1 = require("./utils/error.cjs");
|
|
36
|
+
const fetch_js_1 = require("./singletons/fetch.cjs");
|
|
37
|
+
const index_js_2 = require("./utils/fast-safe-stringify/index.cjs");
|
|
38
|
+
function mergeRuntimeEnvIntoRunCreate(run) {
|
|
39
|
+
const runtimeEnv = (0, env_js_1.getRuntimeEnvironment)();
|
|
40
|
+
const envVars = (0, env_js_1.getLangChainEnvVarsMetadata)();
|
|
41
|
+
const extra = run.extra ?? {};
|
|
42
|
+
const metadata = extra.metadata;
|
|
43
|
+
run.extra = {
|
|
44
|
+
...extra,
|
|
45
|
+
runtime: {
|
|
46
|
+
...runtimeEnv,
|
|
47
|
+
...extra?.runtime,
|
|
48
|
+
},
|
|
49
|
+
metadata: {
|
|
50
|
+
...envVars,
|
|
51
|
+
...(envVars.revision_id || run.revision_id
|
|
52
|
+
? { revision_id: run.revision_id ?? envVars.revision_id }
|
|
53
|
+
: {}),
|
|
54
|
+
...metadata,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
return run;
|
|
58
|
+
}
|
|
59
|
+
exports.mergeRuntimeEnvIntoRunCreate = mergeRuntimeEnvIntoRunCreate;
|
|
60
|
+
const getTracingSamplingRate = () => {
|
|
61
|
+
const samplingRateStr = (0, env_js_1.getLangSmithEnvironmentVariable)("TRACING_SAMPLING_RATE");
|
|
62
|
+
if (samplingRateStr === undefined) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
const samplingRate = parseFloat(samplingRateStr);
|
|
66
|
+
if (samplingRate < 0 || samplingRate > 1) {
|
|
67
|
+
throw new Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${samplingRate}`);
|
|
68
|
+
}
|
|
69
|
+
return samplingRate;
|
|
70
|
+
};
|
|
71
|
+
// utility functions
|
|
72
|
+
const isLocalhost = (url) => {
|
|
73
|
+
const strippedUrl = url.replace("http://", "").replace("https://", "");
|
|
74
|
+
const hostname = strippedUrl.split("/")[0].split(":")[0];
|
|
75
|
+
return (hostname === "localhost" || hostname === "127.0.0.1" || hostname === "::1");
|
|
76
|
+
};
|
|
77
|
+
async function toArray(iterable) {
|
|
78
|
+
const result = [];
|
|
79
|
+
for await (const item of iterable) {
|
|
80
|
+
result.push(item);
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
function trimQuotes(str) {
|
|
85
|
+
if (str === undefined) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
return str
|
|
89
|
+
.trim()
|
|
90
|
+
.replace(/^"(.*)"$/, "$1")
|
|
91
|
+
.replace(/^'(.*)'$/, "$1");
|
|
92
|
+
}
|
|
93
|
+
const handle429 = async (response) => {
|
|
94
|
+
if (response?.status === 429) {
|
|
95
|
+
const retryAfter = parseInt(response.headers.get("retry-after") ?? "30", 10) * 1000;
|
|
96
|
+
if (retryAfter > 0) {
|
|
97
|
+
await new Promise((resolve) => setTimeout(resolve, retryAfter));
|
|
98
|
+
// Return directly after calling this check
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// Fall back to existing status checks
|
|
103
|
+
return false;
|
|
104
|
+
};
|
|
105
|
+
class AutoBatchQueue {
|
|
106
|
+
constructor() {
|
|
107
|
+
Object.defineProperty(this, "items", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
configurable: true,
|
|
110
|
+
writable: true,
|
|
111
|
+
value: []
|
|
112
|
+
});
|
|
113
|
+
Object.defineProperty(this, "sizeBytes", {
|
|
114
|
+
enumerable: true,
|
|
115
|
+
configurable: true,
|
|
116
|
+
writable: true,
|
|
117
|
+
value: 0
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
peek() {
|
|
121
|
+
return this.items[0];
|
|
122
|
+
}
|
|
123
|
+
push(item) {
|
|
124
|
+
let itemPromiseResolve;
|
|
125
|
+
const itemPromise = new Promise((resolve) => {
|
|
126
|
+
// Setting itemPromiseResolve is synchronous with promise creation:
|
|
127
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/Promise
|
|
128
|
+
itemPromiseResolve = resolve;
|
|
129
|
+
});
|
|
130
|
+
const size = (0, index_js_2.serialize)(item.item).length;
|
|
131
|
+
this.items.push({
|
|
132
|
+
action: item.action,
|
|
133
|
+
payload: item.item,
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
135
|
+
itemPromiseResolve: itemPromiseResolve,
|
|
136
|
+
itemPromise,
|
|
137
|
+
size,
|
|
138
|
+
});
|
|
139
|
+
this.sizeBytes += size;
|
|
140
|
+
return itemPromise;
|
|
141
|
+
}
|
|
142
|
+
pop(upToSizeBytes) {
|
|
143
|
+
if (upToSizeBytes < 1) {
|
|
144
|
+
throw new Error("Number of bytes to pop off may not be less than 1.");
|
|
145
|
+
}
|
|
146
|
+
const popped = [];
|
|
147
|
+
let poppedSizeBytes = 0;
|
|
148
|
+
// Pop items until we reach or exceed the size limit
|
|
149
|
+
while (poppedSizeBytes + (this.peek()?.size ?? 0) < upToSizeBytes &&
|
|
150
|
+
this.items.length > 0) {
|
|
151
|
+
const item = this.items.shift();
|
|
152
|
+
if (item) {
|
|
153
|
+
popped.push(item);
|
|
154
|
+
poppedSizeBytes += item.size;
|
|
155
|
+
this.sizeBytes -= item.size;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// If there is an item on the queue we were unable to pop,
|
|
159
|
+
// just return it as a single batch.
|
|
160
|
+
if (popped.length === 0 && this.items.length > 0) {
|
|
161
|
+
const item = this.items.shift();
|
|
162
|
+
popped.push(item);
|
|
163
|
+
poppedSizeBytes += item.size;
|
|
164
|
+
this.sizeBytes -= item.size;
|
|
165
|
+
}
|
|
166
|
+
return [
|
|
167
|
+
popped.map((it) => ({ action: it.action, item: it.payload })),
|
|
168
|
+
() => popped.forEach((it) => it.itemPromiseResolve()),
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.AutoBatchQueue = AutoBatchQueue;
|
|
173
|
+
// 20 MB
|
|
174
|
+
exports.DEFAULT_BATCH_SIZE_LIMIT_BYTES = 20_971_520;
|
|
175
|
+
const SERVER_INFO_REQUEST_TIMEOUT = 2500;
|
|
176
|
+
class Client {
|
|
177
|
+
constructor(config = {}) {
|
|
178
|
+
Object.defineProperty(this, "apiKey", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
configurable: true,
|
|
181
|
+
writable: true,
|
|
182
|
+
value: void 0
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(this, "apiUrl", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
configurable: true,
|
|
187
|
+
writable: true,
|
|
188
|
+
value: void 0
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(this, "webUrl", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
configurable: true,
|
|
193
|
+
writable: true,
|
|
194
|
+
value: void 0
|
|
195
|
+
});
|
|
196
|
+
Object.defineProperty(this, "caller", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
configurable: true,
|
|
199
|
+
writable: true,
|
|
200
|
+
value: void 0
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(this, "batchIngestCaller", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
configurable: true,
|
|
205
|
+
writable: true,
|
|
206
|
+
value: void 0
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(this, "timeout_ms", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
configurable: true,
|
|
211
|
+
writable: true,
|
|
212
|
+
value: void 0
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(this, "_tenantId", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
configurable: true,
|
|
217
|
+
writable: true,
|
|
218
|
+
value: null
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(this, "hideInputs", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
configurable: true,
|
|
223
|
+
writable: true,
|
|
224
|
+
value: void 0
|
|
225
|
+
});
|
|
226
|
+
Object.defineProperty(this, "hideOutputs", {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
configurable: true,
|
|
229
|
+
writable: true,
|
|
230
|
+
value: void 0
|
|
231
|
+
});
|
|
232
|
+
Object.defineProperty(this, "tracingSampleRate", {
|
|
233
|
+
enumerable: true,
|
|
234
|
+
configurable: true,
|
|
235
|
+
writable: true,
|
|
236
|
+
value: void 0
|
|
237
|
+
});
|
|
238
|
+
Object.defineProperty(this, "filteredPostUuids", {
|
|
239
|
+
enumerable: true,
|
|
240
|
+
configurable: true,
|
|
241
|
+
writable: true,
|
|
242
|
+
value: new Set()
|
|
243
|
+
});
|
|
244
|
+
Object.defineProperty(this, "autoBatchTracing", {
|
|
245
|
+
enumerable: true,
|
|
246
|
+
configurable: true,
|
|
247
|
+
writable: true,
|
|
248
|
+
value: true
|
|
249
|
+
});
|
|
250
|
+
Object.defineProperty(this, "autoBatchQueue", {
|
|
251
|
+
enumerable: true,
|
|
252
|
+
configurable: true,
|
|
253
|
+
writable: true,
|
|
254
|
+
value: new AutoBatchQueue()
|
|
255
|
+
});
|
|
256
|
+
Object.defineProperty(this, "autoBatchTimeout", {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
configurable: true,
|
|
259
|
+
writable: true,
|
|
260
|
+
value: void 0
|
|
261
|
+
});
|
|
262
|
+
Object.defineProperty(this, "autoBatchAggregationDelayMs", {
|
|
263
|
+
enumerable: true,
|
|
264
|
+
configurable: true,
|
|
265
|
+
writable: true,
|
|
266
|
+
value: 250
|
|
267
|
+
});
|
|
268
|
+
Object.defineProperty(this, "batchSizeBytesLimit", {
|
|
269
|
+
enumerable: true,
|
|
270
|
+
configurable: true,
|
|
271
|
+
writable: true,
|
|
272
|
+
value: void 0
|
|
273
|
+
});
|
|
274
|
+
Object.defineProperty(this, "fetchOptions", {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
configurable: true,
|
|
277
|
+
writable: true,
|
|
278
|
+
value: void 0
|
|
279
|
+
});
|
|
280
|
+
Object.defineProperty(this, "settings", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
configurable: true,
|
|
283
|
+
writable: true,
|
|
284
|
+
value: void 0
|
|
285
|
+
});
|
|
286
|
+
Object.defineProperty(this, "blockOnRootRunFinalization", {
|
|
287
|
+
enumerable: true,
|
|
288
|
+
configurable: true,
|
|
289
|
+
writable: true,
|
|
290
|
+
value: (0, env_js_1.getEnvironmentVariable)("LANGSMITH_TRACING_BACKGROUND") === "false"
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperty(this, "traceBatchConcurrency", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
configurable: true,
|
|
295
|
+
writable: true,
|
|
296
|
+
value: 5
|
|
297
|
+
});
|
|
298
|
+
Object.defineProperty(this, "_serverInfo", {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
configurable: true,
|
|
301
|
+
writable: true,
|
|
302
|
+
value: void 0
|
|
303
|
+
});
|
|
304
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
305
|
+
Object.defineProperty(this, "_getServerInfoPromise", {
|
|
306
|
+
enumerable: true,
|
|
307
|
+
configurable: true,
|
|
308
|
+
writable: true,
|
|
309
|
+
value: void 0
|
|
310
|
+
});
|
|
311
|
+
Object.defineProperty(this, "manualFlushMode", {
|
|
312
|
+
enumerable: true,
|
|
313
|
+
configurable: true,
|
|
314
|
+
writable: true,
|
|
315
|
+
value: false
|
|
316
|
+
});
|
|
317
|
+
const defaultConfig = Client.getDefaultClientConfig();
|
|
318
|
+
this.tracingSampleRate = getTracingSamplingRate();
|
|
319
|
+
this.apiUrl = trimQuotes(config.apiUrl ?? defaultConfig.apiUrl) ?? "";
|
|
320
|
+
if (this.apiUrl.endsWith("/")) {
|
|
321
|
+
this.apiUrl = this.apiUrl.slice(0, -1);
|
|
322
|
+
}
|
|
323
|
+
this.apiKey = trimQuotes(config.apiKey ?? defaultConfig.apiKey);
|
|
324
|
+
this.webUrl = trimQuotes(config.webUrl ?? defaultConfig.webUrl);
|
|
325
|
+
if (this.webUrl?.endsWith("/")) {
|
|
326
|
+
this.webUrl = this.webUrl.slice(0, -1);
|
|
327
|
+
}
|
|
328
|
+
this.timeout_ms = config.timeout_ms ?? 90_000;
|
|
329
|
+
this.caller = new async_caller_js_1.AsyncCaller(config.callerOptions ?? {});
|
|
330
|
+
this.traceBatchConcurrency =
|
|
331
|
+
config.traceBatchConcurrency ?? this.traceBatchConcurrency;
|
|
332
|
+
if (this.traceBatchConcurrency < 1) {
|
|
333
|
+
throw new Error("Trace batch concurrency must be positive.");
|
|
334
|
+
}
|
|
335
|
+
this.batchIngestCaller = new async_caller_js_1.AsyncCaller({
|
|
336
|
+
maxRetries: 2,
|
|
337
|
+
maxConcurrency: this.traceBatchConcurrency,
|
|
338
|
+
...(config.callerOptions ?? {}),
|
|
339
|
+
onFailedResponseHook: handle429,
|
|
340
|
+
});
|
|
341
|
+
this.hideInputs =
|
|
342
|
+
config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs;
|
|
343
|
+
this.hideOutputs =
|
|
344
|
+
config.hideOutputs ?? config.anonymizer ?? defaultConfig.hideOutputs;
|
|
345
|
+
this.autoBatchTracing = config.autoBatchTracing ?? this.autoBatchTracing;
|
|
346
|
+
this.blockOnRootRunFinalization =
|
|
347
|
+
config.blockOnRootRunFinalization ?? this.blockOnRootRunFinalization;
|
|
348
|
+
this.batchSizeBytesLimit = config.batchSizeBytesLimit;
|
|
349
|
+
this.fetchOptions = config.fetchOptions || {};
|
|
350
|
+
this.manualFlushMode = config.manualFlushMode ?? this.manualFlushMode;
|
|
351
|
+
}
|
|
352
|
+
static getDefaultClientConfig() {
|
|
353
|
+
const apiKey = (0, env_js_1.getLangSmithEnvironmentVariable)("API_KEY");
|
|
354
|
+
const apiUrl = (0, env_js_1.getLangSmithEnvironmentVariable)("ENDPOINT") ??
|
|
355
|
+
"https://api.smith.langchain.com";
|
|
356
|
+
const hideInputs = (0, env_js_1.getLangSmithEnvironmentVariable)("HIDE_INPUTS") === "true";
|
|
357
|
+
const hideOutputs = (0, env_js_1.getLangSmithEnvironmentVariable)("HIDE_OUTPUTS") === "true";
|
|
358
|
+
return {
|
|
359
|
+
apiUrl: apiUrl,
|
|
360
|
+
apiKey: apiKey,
|
|
361
|
+
webUrl: undefined,
|
|
362
|
+
hideInputs: hideInputs,
|
|
363
|
+
hideOutputs: hideOutputs,
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
getHostUrl() {
|
|
367
|
+
if (this.webUrl) {
|
|
368
|
+
return this.webUrl;
|
|
369
|
+
}
|
|
370
|
+
else if (isLocalhost(this.apiUrl)) {
|
|
371
|
+
this.webUrl = "http://localhost:3000";
|
|
372
|
+
return this.webUrl;
|
|
373
|
+
}
|
|
374
|
+
else if (this.apiUrl.endsWith("/api/v1")) {
|
|
375
|
+
this.webUrl = this.apiUrl.replace("/api/v1", "");
|
|
376
|
+
return this.webUrl;
|
|
377
|
+
}
|
|
378
|
+
else if (this.apiUrl.includes("/api") &&
|
|
379
|
+
!this.apiUrl.split(".", 1)[0].endsWith("api")) {
|
|
380
|
+
this.webUrl = this.apiUrl.replace("/api", "");
|
|
381
|
+
return this.webUrl;
|
|
382
|
+
}
|
|
383
|
+
else if (this.apiUrl.split(".", 1)[0].includes("dev")) {
|
|
384
|
+
this.webUrl = "https://dev.smith.langchain.com";
|
|
385
|
+
return this.webUrl;
|
|
386
|
+
}
|
|
387
|
+
else if (this.apiUrl.split(".", 1)[0].includes("eu")) {
|
|
388
|
+
this.webUrl = "https://eu.smith.langchain.com";
|
|
389
|
+
return this.webUrl;
|
|
390
|
+
}
|
|
391
|
+
else if (this.apiUrl.split(".", 1)[0].includes("beta")) {
|
|
392
|
+
this.webUrl = "https://beta.smith.langchain.com";
|
|
393
|
+
return this.webUrl;
|
|
394
|
+
}
|
|
395
|
+
else {
|
|
396
|
+
this.webUrl = "https://smith.langchain.com";
|
|
397
|
+
return this.webUrl;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
get headers() {
|
|
401
|
+
const headers = {
|
|
402
|
+
"User-Agent": `langsmith-js/${index_js_1.__version__}`,
|
|
403
|
+
};
|
|
404
|
+
if (this.apiKey) {
|
|
405
|
+
headers["x-api-key"] = `${this.apiKey}`;
|
|
406
|
+
}
|
|
407
|
+
return headers;
|
|
408
|
+
}
|
|
409
|
+
processInputs(inputs) {
|
|
410
|
+
if (this.hideInputs === false) {
|
|
411
|
+
return inputs;
|
|
412
|
+
}
|
|
413
|
+
if (this.hideInputs === true) {
|
|
414
|
+
return {};
|
|
415
|
+
}
|
|
416
|
+
if (typeof this.hideInputs === "function") {
|
|
417
|
+
return this.hideInputs(inputs);
|
|
418
|
+
}
|
|
419
|
+
return inputs;
|
|
420
|
+
}
|
|
421
|
+
processOutputs(outputs) {
|
|
422
|
+
if (this.hideOutputs === false) {
|
|
423
|
+
return outputs;
|
|
424
|
+
}
|
|
425
|
+
if (this.hideOutputs === true) {
|
|
426
|
+
return {};
|
|
427
|
+
}
|
|
428
|
+
if (typeof this.hideOutputs === "function") {
|
|
429
|
+
return this.hideOutputs(outputs);
|
|
430
|
+
}
|
|
431
|
+
return outputs;
|
|
432
|
+
}
|
|
433
|
+
prepareRunCreateOrUpdateInputs(run) {
|
|
434
|
+
const runParams = { ...run };
|
|
435
|
+
if (runParams.inputs !== undefined) {
|
|
436
|
+
runParams.inputs = this.processInputs(runParams.inputs);
|
|
437
|
+
}
|
|
438
|
+
if (runParams.outputs !== undefined) {
|
|
439
|
+
runParams.outputs = this.processOutputs(runParams.outputs);
|
|
440
|
+
}
|
|
441
|
+
return runParams;
|
|
442
|
+
}
|
|
443
|
+
async _getResponse(path, queryParams) {
|
|
444
|
+
const paramsString = queryParams?.toString() ?? "";
|
|
445
|
+
const url = `${this.apiUrl}${path}?${paramsString}`;
|
|
446
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
|
|
447
|
+
method: "GET",
|
|
448
|
+
headers: this.headers,
|
|
449
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
450
|
+
...this.fetchOptions,
|
|
451
|
+
});
|
|
452
|
+
await (0, error_js_1.raiseForStatus)(response, `Failed to fetch ${path}`);
|
|
453
|
+
return response;
|
|
454
|
+
}
|
|
455
|
+
async _get(path, queryParams) {
|
|
456
|
+
const response = await this._getResponse(path, queryParams);
|
|
457
|
+
return response.json();
|
|
458
|
+
}
|
|
459
|
+
async *_getPaginated(path, queryParams = new URLSearchParams(), transform) {
|
|
460
|
+
let offset = Number(queryParams.get("offset")) || 0;
|
|
461
|
+
const limit = Number(queryParams.get("limit")) || 100;
|
|
462
|
+
while (true) {
|
|
463
|
+
queryParams.set("offset", String(offset));
|
|
464
|
+
queryParams.set("limit", String(limit));
|
|
465
|
+
const url = `${this.apiUrl}${path}?${queryParams}`;
|
|
466
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
|
|
467
|
+
method: "GET",
|
|
468
|
+
headers: this.headers,
|
|
469
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
470
|
+
...this.fetchOptions,
|
|
471
|
+
});
|
|
472
|
+
await (0, error_js_1.raiseForStatus)(response, `Failed to fetch ${path}`);
|
|
473
|
+
const items = transform
|
|
474
|
+
? transform(await response.json())
|
|
475
|
+
: await response.json();
|
|
476
|
+
if (items.length === 0) {
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
yield items;
|
|
480
|
+
if (items.length < limit) {
|
|
481
|
+
break;
|
|
482
|
+
}
|
|
483
|
+
offset += items.length;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
async *_getCursorPaginatedList(path, body = null, requestMethod = "POST", dataKey = "runs") {
|
|
487
|
+
const bodyParams = body ? { ...body } : {};
|
|
488
|
+
while (true) {
|
|
489
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}${path}`, {
|
|
490
|
+
method: requestMethod,
|
|
491
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
492
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
493
|
+
...this.fetchOptions,
|
|
494
|
+
body: JSON.stringify(bodyParams),
|
|
495
|
+
});
|
|
496
|
+
const responseBody = await response.json();
|
|
497
|
+
if (!responseBody) {
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
if (!responseBody[dataKey]) {
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
yield responseBody[dataKey];
|
|
504
|
+
const cursors = responseBody.cursors;
|
|
505
|
+
if (!cursors) {
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
if (!cursors.next) {
|
|
509
|
+
break;
|
|
510
|
+
}
|
|
511
|
+
bodyParams.cursor = cursors.next;
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
_filterForSampling(runs, patch = false) {
|
|
515
|
+
if (this.tracingSampleRate === undefined) {
|
|
516
|
+
return runs;
|
|
517
|
+
}
|
|
518
|
+
if (patch) {
|
|
519
|
+
const sampled = [];
|
|
520
|
+
for (const run of runs) {
|
|
521
|
+
if (!this.filteredPostUuids.has(run.id)) {
|
|
522
|
+
sampled.push(run);
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
this.filteredPostUuids.delete(run.id);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return sampled;
|
|
529
|
+
}
|
|
530
|
+
else {
|
|
531
|
+
const sampled = [];
|
|
532
|
+
for (const run of runs) {
|
|
533
|
+
if ((run.id !== run.trace_id &&
|
|
534
|
+
!this.filteredPostUuids.has(run.trace_id)) ||
|
|
535
|
+
Math.random() < this.tracingSampleRate) {
|
|
536
|
+
sampled.push(run);
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
this.filteredPostUuids.add(run.id);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
return sampled;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
async _getBatchSizeLimitBytes() {
|
|
546
|
+
const serverInfo = await this._ensureServerInfo();
|
|
547
|
+
return (this.batchSizeBytesLimit ??
|
|
548
|
+
serverInfo.batch_ingest_config?.size_limit_bytes ??
|
|
549
|
+
exports.DEFAULT_BATCH_SIZE_LIMIT_BYTES);
|
|
550
|
+
}
|
|
551
|
+
async _getMultiPartSupport() {
|
|
552
|
+
const serverInfo = await this._ensureServerInfo();
|
|
553
|
+
return (serverInfo.instance_flags?.dataset_examples_multipart_enabled ?? false);
|
|
554
|
+
}
|
|
555
|
+
drainAutoBatchQueue(batchSizeLimit) {
|
|
556
|
+
const promises = [];
|
|
557
|
+
while (this.autoBatchQueue.items.length > 0) {
|
|
558
|
+
const [batch, done] = this.autoBatchQueue.pop(batchSizeLimit);
|
|
559
|
+
if (!batch.length) {
|
|
560
|
+
done();
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
const batchPromise = this._processBatch(batch, done).catch(console.error);
|
|
564
|
+
promises.push(batchPromise);
|
|
565
|
+
}
|
|
566
|
+
return Promise.all(promises);
|
|
567
|
+
}
|
|
568
|
+
async _processBatch(batch, done) {
|
|
569
|
+
if (!batch.length) {
|
|
570
|
+
done();
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
try {
|
|
574
|
+
const ingestParams = {
|
|
575
|
+
runCreates: batch
|
|
576
|
+
.filter((item) => item.action === "create")
|
|
577
|
+
.map((item) => item.item),
|
|
578
|
+
runUpdates: batch
|
|
579
|
+
.filter((item) => item.action === "update")
|
|
580
|
+
.map((item) => item.item),
|
|
581
|
+
};
|
|
582
|
+
const serverInfo = await this._ensureServerInfo();
|
|
583
|
+
if (serverInfo?.batch_ingest_config?.use_multipart_endpoint) {
|
|
584
|
+
await this.multipartIngestRuns(ingestParams);
|
|
585
|
+
}
|
|
586
|
+
else {
|
|
587
|
+
await this.batchIngestRuns(ingestParams);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
finally {
|
|
591
|
+
done();
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
async processRunOperation(item) {
|
|
595
|
+
clearTimeout(this.autoBatchTimeout);
|
|
596
|
+
this.autoBatchTimeout = undefined;
|
|
597
|
+
if (item.action === "create") {
|
|
598
|
+
item.item = mergeRuntimeEnvIntoRunCreate(item.item);
|
|
599
|
+
}
|
|
600
|
+
const itemPromise = this.autoBatchQueue.push(item);
|
|
601
|
+
if (this.manualFlushMode) {
|
|
602
|
+
// Rely on manual flushing in serverless environments
|
|
603
|
+
return itemPromise;
|
|
604
|
+
}
|
|
605
|
+
const sizeLimitBytes = await this._getBatchSizeLimitBytes();
|
|
606
|
+
if (this.autoBatchQueue.sizeBytes > sizeLimitBytes) {
|
|
607
|
+
void this.drainAutoBatchQueue(sizeLimitBytes);
|
|
608
|
+
}
|
|
609
|
+
if (this.autoBatchQueue.items.length > 0) {
|
|
610
|
+
this.autoBatchTimeout = setTimeout(() => {
|
|
611
|
+
this.autoBatchTimeout = undefined;
|
|
612
|
+
void this.drainAutoBatchQueue(sizeLimitBytes);
|
|
613
|
+
}, this.autoBatchAggregationDelayMs);
|
|
614
|
+
}
|
|
615
|
+
return itemPromise;
|
|
616
|
+
}
|
|
617
|
+
async _getServerInfo() {
|
|
618
|
+
const response = await (0, fetch_js_1._getFetchImplementation)()(`${this.apiUrl}/info`, {
|
|
619
|
+
method: "GET",
|
|
620
|
+
headers: { Accept: "application/json" },
|
|
621
|
+
signal: AbortSignal.timeout(SERVER_INFO_REQUEST_TIMEOUT),
|
|
622
|
+
...this.fetchOptions,
|
|
623
|
+
});
|
|
624
|
+
await (0, error_js_1.raiseForStatus)(response, "get server info");
|
|
625
|
+
return response.json();
|
|
626
|
+
}
|
|
627
|
+
async _ensureServerInfo() {
|
|
628
|
+
if (this._getServerInfoPromise === undefined) {
|
|
629
|
+
this._getServerInfoPromise = (async () => {
|
|
630
|
+
if (this._serverInfo === undefined) {
|
|
631
|
+
try {
|
|
632
|
+
this._serverInfo = await this._getServerInfo();
|
|
633
|
+
}
|
|
634
|
+
catch (e) {
|
|
635
|
+
console.warn(`[WARNING]: LangSmith failed to fetch info on supported operations. Falling back to batch operations and default limits.`);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
return this._serverInfo ?? {};
|
|
639
|
+
})();
|
|
640
|
+
}
|
|
641
|
+
return this._getServerInfoPromise.then((serverInfo) => {
|
|
642
|
+
if (this._serverInfo === undefined) {
|
|
643
|
+
this._getServerInfoPromise = undefined;
|
|
644
|
+
}
|
|
645
|
+
return serverInfo;
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
async _getSettings() {
|
|
649
|
+
if (!this.settings) {
|
|
650
|
+
this.settings = this._get("/settings");
|
|
651
|
+
}
|
|
652
|
+
return await this.settings;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Flushes current queued traces.
|
|
656
|
+
*/
|
|
657
|
+
async flush() {
|
|
658
|
+
const sizeLimitBytes = await this._getBatchSizeLimitBytes();
|
|
659
|
+
await this.drainAutoBatchQueue(sizeLimitBytes);
|
|
660
|
+
}
|
|
661
|
+
async createRun(run) {
|
|
662
|
+
if (!this._filterForSampling([run]).length) {
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
const headers = { ...this.headers, "Content-Type": "application/json" };
|
|
666
|
+
const session_name = run.project_name;
|
|
667
|
+
delete run.project_name;
|
|
668
|
+
const runCreate = this.prepareRunCreateOrUpdateInputs({
|
|
669
|
+
session_name,
|
|
670
|
+
...run,
|
|
671
|
+
start_time: run.start_time ?? Date.now(),
|
|
672
|
+
});
|
|
673
|
+
if (this.autoBatchTracing &&
|
|
674
|
+
runCreate.trace_id !== undefined &&
|
|
675
|
+
runCreate.dotted_order !== undefined) {
|
|
676
|
+
void this.processRunOperation({
|
|
677
|
+
action: "create",
|
|
678
|
+
item: runCreate,
|
|
679
|
+
}).catch(console.error);
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
const mergedRunCreateParam = mergeRuntimeEnvIntoRunCreate(runCreate);
|
|
683
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs`, {
|
|
684
|
+
method: "POST",
|
|
685
|
+
headers,
|
|
686
|
+
body: (0, index_js_2.serialize)(mergedRunCreateParam),
|
|
687
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
688
|
+
...this.fetchOptions,
|
|
689
|
+
});
|
|
690
|
+
await (0, error_js_1.raiseForStatus)(response, "create run", true);
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
* Batch ingest/upsert multiple runs in the Langsmith system.
|
|
694
|
+
* @param runs
|
|
695
|
+
*/
|
|
696
|
+
async batchIngestRuns({ runCreates, runUpdates, }) {
|
|
697
|
+
if (runCreates === undefined && runUpdates === undefined) {
|
|
698
|
+
return;
|
|
699
|
+
}
|
|
700
|
+
let preparedCreateParams = runCreates?.map((create) => this.prepareRunCreateOrUpdateInputs(create)) ?? [];
|
|
701
|
+
let preparedUpdateParams = runUpdates?.map((update) => this.prepareRunCreateOrUpdateInputs(update)) ?? [];
|
|
702
|
+
if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) {
|
|
703
|
+
const createById = preparedCreateParams.reduce((params, run) => {
|
|
704
|
+
if (!run.id) {
|
|
705
|
+
return params;
|
|
706
|
+
}
|
|
707
|
+
params[run.id] = run;
|
|
708
|
+
return params;
|
|
709
|
+
}, {});
|
|
710
|
+
const standaloneUpdates = [];
|
|
711
|
+
for (const updateParam of preparedUpdateParams) {
|
|
712
|
+
if (updateParam.id !== undefined && createById[updateParam.id]) {
|
|
713
|
+
createById[updateParam.id] = {
|
|
714
|
+
...createById[updateParam.id],
|
|
715
|
+
...updateParam,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
standaloneUpdates.push(updateParam);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
preparedCreateParams = Object.values(createById);
|
|
723
|
+
preparedUpdateParams = standaloneUpdates;
|
|
724
|
+
}
|
|
725
|
+
const rawBatch = {
|
|
726
|
+
post: this._filterForSampling(preparedCreateParams),
|
|
727
|
+
patch: this._filterForSampling(preparedUpdateParams, true),
|
|
728
|
+
};
|
|
729
|
+
if (!rawBatch.post.length && !rawBatch.patch.length) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
const batchChunks = {
|
|
733
|
+
post: [],
|
|
734
|
+
patch: [],
|
|
735
|
+
};
|
|
736
|
+
for (const k of ["post", "patch"]) {
|
|
737
|
+
const key = k;
|
|
738
|
+
const batchItems = rawBatch[key].reverse();
|
|
739
|
+
let batchItem = batchItems.pop();
|
|
740
|
+
while (batchItem !== undefined) {
|
|
741
|
+
batchChunks[key].push(batchItem);
|
|
742
|
+
batchItem = batchItems.pop();
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
if (batchChunks.post.length > 0 || batchChunks.patch.length > 0) {
|
|
746
|
+
await this._postBatchIngestRuns((0, index_js_2.serialize)(batchChunks));
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
async _postBatchIngestRuns(body) {
|
|
750
|
+
const headers = {
|
|
751
|
+
...this.headers,
|
|
752
|
+
"Content-Type": "application/json",
|
|
753
|
+
Accept: "application/json",
|
|
754
|
+
};
|
|
755
|
+
const response = await this.batchIngestCaller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/batch`, {
|
|
756
|
+
method: "POST",
|
|
757
|
+
headers,
|
|
758
|
+
body: body,
|
|
759
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
760
|
+
...this.fetchOptions,
|
|
761
|
+
});
|
|
762
|
+
await (0, error_js_1.raiseForStatus)(response, "batch create run", true);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Batch ingest/upsert multiple runs in the Langsmith system.
|
|
766
|
+
* @param runs
|
|
767
|
+
*/
|
|
768
|
+
async multipartIngestRuns({ runCreates, runUpdates, }) {
|
|
769
|
+
if (runCreates === undefined && runUpdates === undefined) {
|
|
770
|
+
return;
|
|
771
|
+
}
|
|
772
|
+
// transform and convert to dicts
|
|
773
|
+
const allAttachments = {};
|
|
774
|
+
let preparedCreateParams = [];
|
|
775
|
+
for (const create of runCreates ?? []) {
|
|
776
|
+
const preparedCreate = this.prepareRunCreateOrUpdateInputs(create);
|
|
777
|
+
if (preparedCreate.id !== undefined &&
|
|
778
|
+
preparedCreate.attachments !== undefined) {
|
|
779
|
+
allAttachments[preparedCreate.id] = preparedCreate.attachments;
|
|
780
|
+
}
|
|
781
|
+
delete preparedCreate.attachments;
|
|
782
|
+
preparedCreateParams.push(preparedCreate);
|
|
783
|
+
}
|
|
784
|
+
let preparedUpdateParams = [];
|
|
785
|
+
for (const update of runUpdates ?? []) {
|
|
786
|
+
preparedUpdateParams.push(this.prepareRunCreateOrUpdateInputs(update));
|
|
787
|
+
}
|
|
788
|
+
// require trace_id and dotted_order
|
|
789
|
+
const invalidRunCreate = preparedCreateParams.find((runCreate) => {
|
|
790
|
+
return (runCreate.trace_id === undefined || runCreate.dotted_order === undefined);
|
|
791
|
+
});
|
|
792
|
+
if (invalidRunCreate !== undefined) {
|
|
793
|
+
throw new Error(`Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run`);
|
|
794
|
+
}
|
|
795
|
+
const invalidRunUpdate = preparedUpdateParams.find((runUpdate) => {
|
|
796
|
+
return (runUpdate.trace_id === undefined || runUpdate.dotted_order === undefined);
|
|
797
|
+
});
|
|
798
|
+
if (invalidRunUpdate !== undefined) {
|
|
799
|
+
throw new Error(`Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run`);
|
|
800
|
+
}
|
|
801
|
+
// combine post and patch dicts where possible
|
|
802
|
+
if (preparedCreateParams.length > 0 && preparedUpdateParams.length > 0) {
|
|
803
|
+
const createById = preparedCreateParams.reduce((params, run) => {
|
|
804
|
+
if (!run.id) {
|
|
805
|
+
return params;
|
|
806
|
+
}
|
|
807
|
+
params[run.id] = run;
|
|
808
|
+
return params;
|
|
809
|
+
}, {});
|
|
810
|
+
const standaloneUpdates = [];
|
|
811
|
+
for (const updateParam of preparedUpdateParams) {
|
|
812
|
+
if (updateParam.id !== undefined && createById[updateParam.id]) {
|
|
813
|
+
createById[updateParam.id] = {
|
|
814
|
+
...createById[updateParam.id],
|
|
815
|
+
...updateParam,
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
else {
|
|
819
|
+
standaloneUpdates.push(updateParam);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
preparedCreateParams = Object.values(createById);
|
|
823
|
+
preparedUpdateParams = standaloneUpdates;
|
|
824
|
+
}
|
|
825
|
+
if (preparedCreateParams.length === 0 &&
|
|
826
|
+
preparedUpdateParams.length === 0) {
|
|
827
|
+
return;
|
|
828
|
+
}
|
|
829
|
+
// send the runs in multipart requests
|
|
830
|
+
const accumulatedContext = [];
|
|
831
|
+
const accumulatedParts = [];
|
|
832
|
+
for (const [method, payloads] of [
|
|
833
|
+
["post", preparedCreateParams],
|
|
834
|
+
["patch", preparedUpdateParams],
|
|
835
|
+
]) {
|
|
836
|
+
for (const originalPayload of payloads) {
|
|
837
|
+
// collect fields to be sent as separate parts
|
|
838
|
+
const { inputs, outputs, events, attachments, ...payload } = originalPayload;
|
|
839
|
+
const fields = { inputs, outputs, events };
|
|
840
|
+
// encode the main run payload
|
|
841
|
+
const stringifiedPayload = (0, index_js_2.serialize)(payload);
|
|
842
|
+
accumulatedParts.push({
|
|
843
|
+
name: `${method}.${payload.id}`,
|
|
844
|
+
payload: new Blob([stringifiedPayload], {
|
|
845
|
+
type: `application/json; length=${stringifiedPayload.length}`, // encoding=gzip
|
|
846
|
+
}),
|
|
847
|
+
});
|
|
848
|
+
// encode the fields we collected
|
|
849
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
850
|
+
if (value === undefined) {
|
|
851
|
+
continue;
|
|
852
|
+
}
|
|
853
|
+
const stringifiedValue = (0, index_js_2.serialize)(value);
|
|
854
|
+
accumulatedParts.push({
|
|
855
|
+
name: `${method}.${payload.id}.${key}`,
|
|
856
|
+
payload: new Blob([stringifiedValue], {
|
|
857
|
+
type: `application/json; length=${stringifiedValue.length}`,
|
|
858
|
+
}),
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
// encode the attachments
|
|
862
|
+
if (payload.id !== undefined) {
|
|
863
|
+
const attachments = allAttachments[payload.id];
|
|
864
|
+
if (attachments) {
|
|
865
|
+
delete allAttachments[payload.id];
|
|
866
|
+
for (const [name, attachment] of Object.entries(attachments)) {
|
|
867
|
+
let contentType;
|
|
868
|
+
let content;
|
|
869
|
+
if (Array.isArray(attachment)) {
|
|
870
|
+
[contentType, content] = attachment;
|
|
871
|
+
}
|
|
872
|
+
else {
|
|
873
|
+
contentType = attachment.mimeType;
|
|
874
|
+
content = attachment.data;
|
|
875
|
+
}
|
|
876
|
+
// Validate that the attachment name doesn't contain a '.'
|
|
877
|
+
if (name.includes(".")) {
|
|
878
|
+
console.warn(`Skipping attachment '${name}' for run ${payload.id}: Invalid attachment name. ` +
|
|
879
|
+
`Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
accumulatedParts.push({
|
|
883
|
+
name: `attachment.${payload.id}.${name}`,
|
|
884
|
+
payload: new Blob([content], {
|
|
885
|
+
type: `${contentType}; length=${content.byteLength}`,
|
|
886
|
+
}),
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
// compute context
|
|
892
|
+
accumulatedContext.push(`trace=${payload.trace_id},id=${payload.id}`);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
await this._sendMultipartRequest(accumulatedParts, accumulatedContext.join("; "));
|
|
896
|
+
}
|
|
897
|
+
async _sendMultipartRequest(parts, context) {
|
|
898
|
+
try {
|
|
899
|
+
// Create multipart form data manually using Blobs
|
|
900
|
+
const boundary = "----LangSmithFormBoundary" + Math.random().toString(36).slice(2);
|
|
901
|
+
const chunks = [];
|
|
902
|
+
for (const part of parts) {
|
|
903
|
+
// Add field boundary
|
|
904
|
+
chunks.push(new Blob([`--${boundary}\r\n`]));
|
|
905
|
+
chunks.push(new Blob([
|
|
906
|
+
`Content-Disposition: form-data; name="${part.name}"\r\n`,
|
|
907
|
+
`Content-Type: ${part.payload.type}\r\n\r\n`,
|
|
908
|
+
]));
|
|
909
|
+
chunks.push(part.payload);
|
|
910
|
+
chunks.push(new Blob(["\r\n"]));
|
|
911
|
+
}
|
|
912
|
+
// Add final boundary
|
|
913
|
+
chunks.push(new Blob([`--${boundary}--\r\n`]));
|
|
914
|
+
// Combine all chunks into a single Blob
|
|
915
|
+
const body = new Blob(chunks);
|
|
916
|
+
// Convert Blob to ArrayBuffer for compatibility
|
|
917
|
+
const arrayBuffer = await body.arrayBuffer();
|
|
918
|
+
const res = await this.batchIngestCaller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/multipart`, {
|
|
919
|
+
method: "POST",
|
|
920
|
+
headers: {
|
|
921
|
+
...this.headers,
|
|
922
|
+
"Content-Type": `multipart/form-data; boundary=${boundary}`,
|
|
923
|
+
},
|
|
924
|
+
body: arrayBuffer,
|
|
925
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
926
|
+
...this.fetchOptions,
|
|
927
|
+
});
|
|
928
|
+
await (0, error_js_1.raiseForStatus)(res, "ingest multipart runs", true);
|
|
929
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
930
|
+
}
|
|
931
|
+
catch (e) {
|
|
932
|
+
console.warn(`${e.message.trim()}\n\nContext: ${context}`);
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
async updateRun(runId, run) {
|
|
936
|
+
(0, _uuid_js_1.assertUuid)(runId);
|
|
937
|
+
if (run.inputs) {
|
|
938
|
+
run.inputs = this.processInputs(run.inputs);
|
|
939
|
+
}
|
|
940
|
+
if (run.outputs) {
|
|
941
|
+
run.outputs = this.processOutputs(run.outputs);
|
|
942
|
+
}
|
|
943
|
+
// TODO: Untangle types
|
|
944
|
+
const data = { ...run, id: runId };
|
|
945
|
+
if (!this._filterForSampling([data], true).length) {
|
|
946
|
+
return;
|
|
947
|
+
}
|
|
948
|
+
if (this.autoBatchTracing &&
|
|
949
|
+
data.trace_id !== undefined &&
|
|
950
|
+
data.dotted_order !== undefined) {
|
|
951
|
+
if (run.end_time !== undefined &&
|
|
952
|
+
data.parent_run_id === undefined &&
|
|
953
|
+
this.blockOnRootRunFinalization &&
|
|
954
|
+
!this.manualFlushMode) {
|
|
955
|
+
// Trigger batches as soon as a root trace ends and wait to ensure trace finishes
|
|
956
|
+
// in serverless environments.
|
|
957
|
+
await this.processRunOperation({ action: "update", item: data }).catch(console.error);
|
|
958
|
+
return;
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
void this.processRunOperation({ action: "update", item: data }).catch(console.error);
|
|
962
|
+
}
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
const headers = { ...this.headers, "Content-Type": "application/json" };
|
|
966
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}`, {
|
|
967
|
+
method: "PATCH",
|
|
968
|
+
headers,
|
|
969
|
+
body: (0, index_js_2.serialize)(run),
|
|
970
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
971
|
+
...this.fetchOptions,
|
|
972
|
+
});
|
|
973
|
+
await (0, error_js_1.raiseForStatus)(response, "update run", true);
|
|
974
|
+
}
|
|
975
|
+
async readRun(runId, { loadChildRuns } = { loadChildRuns: false }) {
|
|
976
|
+
(0, _uuid_js_1.assertUuid)(runId);
|
|
977
|
+
let run = await this._get(`/runs/${runId}`);
|
|
978
|
+
if (loadChildRuns && run.child_run_ids) {
|
|
979
|
+
run = await this._loadChildRuns(run);
|
|
980
|
+
}
|
|
981
|
+
return run;
|
|
982
|
+
}
|
|
983
|
+
async getRunUrl({ runId, run, projectOpts, }) {
|
|
984
|
+
if (run !== undefined) {
|
|
985
|
+
let sessionId;
|
|
986
|
+
if (run.session_id) {
|
|
987
|
+
sessionId = run.session_id;
|
|
988
|
+
}
|
|
989
|
+
else if (projectOpts?.projectName) {
|
|
990
|
+
sessionId = (await this.readProject({ projectName: projectOpts?.projectName })).id;
|
|
991
|
+
}
|
|
992
|
+
else if (projectOpts?.projectId) {
|
|
993
|
+
sessionId = projectOpts?.projectId;
|
|
994
|
+
}
|
|
995
|
+
else {
|
|
996
|
+
const project = await this.readProject({
|
|
997
|
+
projectName: (0, env_js_1.getLangSmithEnvironmentVariable)("PROJECT") || "default",
|
|
998
|
+
});
|
|
999
|
+
sessionId = project.id;
|
|
1000
|
+
}
|
|
1001
|
+
const tenantId = await this._getTenantId();
|
|
1002
|
+
return `${this.getHostUrl()}/o/${tenantId}/projects/p/${sessionId}/r/${run.id}?poll=true`;
|
|
1003
|
+
}
|
|
1004
|
+
else if (runId !== undefined) {
|
|
1005
|
+
const run_ = await this.readRun(runId);
|
|
1006
|
+
if (!run_.app_path) {
|
|
1007
|
+
throw new Error(`Run ${runId} has no app_path`);
|
|
1008
|
+
}
|
|
1009
|
+
const baseUrl = this.getHostUrl();
|
|
1010
|
+
return `${baseUrl}${run_.app_path}`;
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
throw new Error("Must provide either runId or run");
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
async _loadChildRuns(run) {
|
|
1017
|
+
const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
|
|
1018
|
+
const treemap = {};
|
|
1019
|
+
const runs = {};
|
|
1020
|
+
// TODO: make dotted order required when the migration finishes
|
|
1021
|
+
childRuns.sort((a, b) => (a?.dotted_order ?? "").localeCompare(b?.dotted_order ?? ""));
|
|
1022
|
+
for (const childRun of childRuns) {
|
|
1023
|
+
if (childRun.parent_run_id === null ||
|
|
1024
|
+
childRun.parent_run_id === undefined) {
|
|
1025
|
+
throw new Error(`Child run ${childRun.id} has no parent`);
|
|
1026
|
+
}
|
|
1027
|
+
if (!(childRun.parent_run_id in treemap)) {
|
|
1028
|
+
treemap[childRun.parent_run_id] = [];
|
|
1029
|
+
}
|
|
1030
|
+
treemap[childRun.parent_run_id].push(childRun);
|
|
1031
|
+
runs[childRun.id] = childRun;
|
|
1032
|
+
}
|
|
1033
|
+
run.child_runs = treemap[run.id] || [];
|
|
1034
|
+
for (const runId in treemap) {
|
|
1035
|
+
if (runId !== run.id) {
|
|
1036
|
+
runs[runId].child_runs = treemap[runId];
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
return run;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* List runs from the LangSmith server.
|
|
1043
|
+
* @param projectId - The ID of the project to filter by.
|
|
1044
|
+
* @param projectName - The name of the project to filter by.
|
|
1045
|
+
* @param parentRunId - The ID of the parent run to filter by.
|
|
1046
|
+
* @param traceId - The ID of the trace to filter by.
|
|
1047
|
+
* @param referenceExampleId - The ID of the reference example to filter by.
|
|
1048
|
+
* @param startTime - The start time to filter by.
|
|
1049
|
+
* @param isRoot - Indicates whether to only return root runs.
|
|
1050
|
+
* @param runType - The run type to filter by.
|
|
1051
|
+
* @param error - Indicates whether to filter by error runs.
|
|
1052
|
+
* @param id - The ID of the run to filter by.
|
|
1053
|
+
* @param query - The query string to filter by.
|
|
1054
|
+
* @param filter - The filter string to apply to the run spans.
|
|
1055
|
+
* @param traceFilter - The filter string to apply on the root run of the trace.
|
|
1056
|
+
* @param treeFilter - The filter string to apply on other runs in the trace.
|
|
1057
|
+
* @param limit - The maximum number of runs to retrieve.
|
|
1058
|
+
* @returns {AsyncIterable<Run>} - The runs.
|
|
1059
|
+
*
|
|
1060
|
+
* @example
|
|
1061
|
+
* // List all runs in a project
|
|
1062
|
+
* const projectRuns = client.listRuns({ projectName: "<your_project>" });
|
|
1063
|
+
*
|
|
1064
|
+
* @example
|
|
1065
|
+
* // List LLM and Chat runs in the last 24 hours
|
|
1066
|
+
* const todaysLLMRuns = client.listRuns({
|
|
1067
|
+
* projectName: "<your_project>",
|
|
1068
|
+
* start_time: new Date(Date.now() - 24 * 60 * 60 * 1000),
|
|
1069
|
+
* run_type: "llm",
|
|
1070
|
+
* });
|
|
1071
|
+
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* // List traces in a project
|
|
1074
|
+
* const rootRuns = client.listRuns({
|
|
1075
|
+
* projectName: "<your_project>",
|
|
1076
|
+
* execution_order: 1,
|
|
1077
|
+
* });
|
|
1078
|
+
*
|
|
1079
|
+
* @example
|
|
1080
|
+
* // List runs without errors
|
|
1081
|
+
* const correctRuns = client.listRuns({
|
|
1082
|
+
* projectName: "<your_project>",
|
|
1083
|
+
* error: false,
|
|
1084
|
+
* });
|
|
1085
|
+
*
|
|
1086
|
+
* @example
|
|
1087
|
+
* // List runs by run ID
|
|
1088
|
+
* const runIds = [
|
|
1089
|
+
* "a36092d2-4ad5-4fb4-9c0d-0dba9a2ed836",
|
|
1090
|
+
* "9398e6be-964f-4aa4-8ae9-ad78cd4b7074",
|
|
1091
|
+
* ];
|
|
1092
|
+
* const selectedRuns = client.listRuns({ run_ids: runIds });
|
|
1093
|
+
*
|
|
1094
|
+
* @example
|
|
1095
|
+
* // List all "chain" type runs that took more than 10 seconds and had `total_tokens` greater than 5000
|
|
1096
|
+
* const chainRuns = client.listRuns({
|
|
1097
|
+
* projectName: "<your_project>",
|
|
1098
|
+
* filter: 'and(eq(run_type, "chain"), gt(latency, 10), gt(total_tokens, 5000))',
|
|
1099
|
+
* });
|
|
1100
|
+
*
|
|
1101
|
+
* @example
|
|
1102
|
+
* // List all runs called "extractor" whose root of the trace was assigned feedback "user_score" score of 1
|
|
1103
|
+
* const goodExtractorRuns = client.listRuns({
|
|
1104
|
+
* projectName: "<your_project>",
|
|
1105
|
+
* filter: 'eq(name, "extractor")',
|
|
1106
|
+
* traceFilter: 'and(eq(feedback_key, "user_score"), eq(feedback_score, 1))',
|
|
1107
|
+
* });
|
|
1108
|
+
*
|
|
1109
|
+
* @example
|
|
1110
|
+
* // List all runs that started after a specific timestamp and either have "error" not equal to null or a "Correctness" feedback score equal to 0
|
|
1111
|
+
* const complexRuns = client.listRuns({
|
|
1112
|
+
* projectName: "<your_project>",
|
|
1113
|
+
* filter: 'and(gt(start_time, "2023-07-15T12:34:56Z"), or(neq(error, null), and(eq(feedback_key, "Correctness"), eq(feedback_score, 0.0))))',
|
|
1114
|
+
* });
|
|
1115
|
+
*
|
|
1116
|
+
* @example
|
|
1117
|
+
* // List all runs where `tags` include "experimental" or "beta" and `latency` is greater than 2 seconds
|
|
1118
|
+
* const taggedRuns = client.listRuns({
|
|
1119
|
+
* projectName: "<your_project>",
|
|
1120
|
+
* filter: 'and(or(has(tags, "experimental"), has(tags, "beta")), gt(latency, 2))',
|
|
1121
|
+
* });
|
|
1122
|
+
*/
|
|
1123
|
+
async *listRuns(props) {
|
|
1124
|
+
const { projectId, projectName, parentRunId, traceId, referenceExampleId, startTime, executionOrder, isRoot, runType, error, id, query, filter, traceFilter, treeFilter, limit, select, } = props;
|
|
1125
|
+
let projectIds = [];
|
|
1126
|
+
if (projectId) {
|
|
1127
|
+
projectIds = Array.isArray(projectId) ? projectId : [projectId];
|
|
1128
|
+
}
|
|
1129
|
+
if (projectName) {
|
|
1130
|
+
const projectNames = Array.isArray(projectName)
|
|
1131
|
+
? projectName
|
|
1132
|
+
: [projectName];
|
|
1133
|
+
const projectIds_ = await Promise.all(projectNames.map((name) => this.readProject({ projectName: name }).then((project) => project.id)));
|
|
1134
|
+
projectIds.push(...projectIds_);
|
|
1135
|
+
}
|
|
1136
|
+
const default_select = [
|
|
1137
|
+
"app_path",
|
|
1138
|
+
"child_run_ids",
|
|
1139
|
+
"completion_cost",
|
|
1140
|
+
"completion_tokens",
|
|
1141
|
+
"dotted_order",
|
|
1142
|
+
"end_time",
|
|
1143
|
+
"error",
|
|
1144
|
+
"events",
|
|
1145
|
+
"extra",
|
|
1146
|
+
"feedback_stats",
|
|
1147
|
+
"first_token_time",
|
|
1148
|
+
"id",
|
|
1149
|
+
"inputs",
|
|
1150
|
+
"name",
|
|
1151
|
+
"outputs",
|
|
1152
|
+
"parent_run_id",
|
|
1153
|
+
"parent_run_ids",
|
|
1154
|
+
"prompt_cost",
|
|
1155
|
+
"prompt_tokens",
|
|
1156
|
+
"reference_example_id",
|
|
1157
|
+
"run_type",
|
|
1158
|
+
"session_id",
|
|
1159
|
+
"start_time",
|
|
1160
|
+
"status",
|
|
1161
|
+
"tags",
|
|
1162
|
+
"total_cost",
|
|
1163
|
+
"total_tokens",
|
|
1164
|
+
"trace_id",
|
|
1165
|
+
];
|
|
1166
|
+
const body = {
|
|
1167
|
+
session: projectIds.length ? projectIds : null,
|
|
1168
|
+
run_type: runType,
|
|
1169
|
+
reference_example: referenceExampleId,
|
|
1170
|
+
query,
|
|
1171
|
+
filter,
|
|
1172
|
+
trace_filter: traceFilter,
|
|
1173
|
+
tree_filter: treeFilter,
|
|
1174
|
+
execution_order: executionOrder,
|
|
1175
|
+
parent_run: parentRunId,
|
|
1176
|
+
start_time: startTime ? startTime.toISOString() : null,
|
|
1177
|
+
error,
|
|
1178
|
+
id,
|
|
1179
|
+
limit,
|
|
1180
|
+
trace: traceId,
|
|
1181
|
+
select: select ? select : default_select,
|
|
1182
|
+
is_root: isRoot,
|
|
1183
|
+
};
|
|
1184
|
+
let runsYielded = 0;
|
|
1185
|
+
for await (const runs of this._getCursorPaginatedList("/runs/query", body)) {
|
|
1186
|
+
if (limit) {
|
|
1187
|
+
if (runsYielded >= limit) {
|
|
1188
|
+
break;
|
|
1189
|
+
}
|
|
1190
|
+
if (runs.length + runsYielded > limit) {
|
|
1191
|
+
const newRuns = runs.slice(0, limit - runsYielded);
|
|
1192
|
+
yield* newRuns;
|
|
1193
|
+
break;
|
|
1194
|
+
}
|
|
1195
|
+
runsYielded += runs.length;
|
|
1196
|
+
yield* runs;
|
|
1197
|
+
}
|
|
1198
|
+
else {
|
|
1199
|
+
yield* runs;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
async getRunStats({ id, trace, parentRun, runType, projectNames, projectIds, referenceExampleIds, startTime, endTime, error, query, filter, traceFilter, treeFilter, isRoot, dataSourceType, }) {
|
|
1204
|
+
let projectIds_ = projectIds || [];
|
|
1205
|
+
if (projectNames) {
|
|
1206
|
+
projectIds_ = [
|
|
1207
|
+
...(projectIds || []),
|
|
1208
|
+
...(await Promise.all(projectNames.map((name) => this.readProject({ projectName: name }).then((project) => project.id)))),
|
|
1209
|
+
];
|
|
1210
|
+
}
|
|
1211
|
+
const payload = {
|
|
1212
|
+
id,
|
|
1213
|
+
trace,
|
|
1214
|
+
parent_run: parentRun,
|
|
1215
|
+
run_type: runType,
|
|
1216
|
+
session: projectIds_,
|
|
1217
|
+
reference_example: referenceExampleIds,
|
|
1218
|
+
start_time: startTime,
|
|
1219
|
+
end_time: endTime,
|
|
1220
|
+
error,
|
|
1221
|
+
query,
|
|
1222
|
+
filter,
|
|
1223
|
+
trace_filter: traceFilter,
|
|
1224
|
+
tree_filter: treeFilter,
|
|
1225
|
+
is_root: isRoot,
|
|
1226
|
+
data_source_type: dataSourceType,
|
|
1227
|
+
};
|
|
1228
|
+
// Remove undefined values from the payload
|
|
1229
|
+
const filteredPayload = Object.fromEntries(Object.entries(payload).filter(([_, value]) => value !== undefined));
|
|
1230
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/stats`, {
|
|
1231
|
+
method: "POST",
|
|
1232
|
+
headers: this.headers,
|
|
1233
|
+
body: JSON.stringify(filteredPayload),
|
|
1234
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1235
|
+
...this.fetchOptions,
|
|
1236
|
+
});
|
|
1237
|
+
const result = await response.json();
|
|
1238
|
+
return result;
|
|
1239
|
+
}
|
|
1240
|
+
async shareRun(runId, { shareId } = {}) {
|
|
1241
|
+
const data = {
|
|
1242
|
+
run_id: runId,
|
|
1243
|
+
share_token: shareId || uuid.v4(),
|
|
1244
|
+
};
|
|
1245
|
+
(0, _uuid_js_1.assertUuid)(runId);
|
|
1246
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}/share`, {
|
|
1247
|
+
method: "PUT",
|
|
1248
|
+
headers: this.headers,
|
|
1249
|
+
body: JSON.stringify(data),
|
|
1250
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1251
|
+
...this.fetchOptions,
|
|
1252
|
+
});
|
|
1253
|
+
const result = await response.json();
|
|
1254
|
+
if (result === null || !("share_token" in result)) {
|
|
1255
|
+
throw new Error("Invalid response from server");
|
|
1256
|
+
}
|
|
1257
|
+
return `${this.getHostUrl()}/public/${result["share_token"]}/r`;
|
|
1258
|
+
}
|
|
1259
|
+
async unshareRun(runId) {
|
|
1260
|
+
(0, _uuid_js_1.assertUuid)(runId);
|
|
1261
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}/share`, {
|
|
1262
|
+
method: "DELETE",
|
|
1263
|
+
headers: this.headers,
|
|
1264
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1265
|
+
...this.fetchOptions,
|
|
1266
|
+
});
|
|
1267
|
+
await (0, error_js_1.raiseForStatus)(response, "unshare run", true);
|
|
1268
|
+
}
|
|
1269
|
+
async readRunSharedLink(runId) {
|
|
1270
|
+
(0, _uuid_js_1.assertUuid)(runId);
|
|
1271
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/runs/${runId}/share`, {
|
|
1272
|
+
method: "GET",
|
|
1273
|
+
headers: this.headers,
|
|
1274
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1275
|
+
...this.fetchOptions,
|
|
1276
|
+
});
|
|
1277
|
+
const result = await response.json();
|
|
1278
|
+
if (result === null || !("share_token" in result)) {
|
|
1279
|
+
return undefined;
|
|
1280
|
+
}
|
|
1281
|
+
return `${this.getHostUrl()}/public/${result["share_token"]}/r`;
|
|
1282
|
+
}
|
|
1283
|
+
async listSharedRuns(shareToken, { runIds, } = {}) {
|
|
1284
|
+
const queryParams = new URLSearchParams({
|
|
1285
|
+
share_token: shareToken,
|
|
1286
|
+
});
|
|
1287
|
+
if (runIds !== undefined) {
|
|
1288
|
+
for (const runId of runIds) {
|
|
1289
|
+
queryParams.append("id", runId);
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
(0, _uuid_js_1.assertUuid)(shareToken);
|
|
1293
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/public/${shareToken}/runs${queryParams}`, {
|
|
1294
|
+
method: "GET",
|
|
1295
|
+
headers: this.headers,
|
|
1296
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1297
|
+
...this.fetchOptions,
|
|
1298
|
+
});
|
|
1299
|
+
const runs = await response.json();
|
|
1300
|
+
return runs;
|
|
1301
|
+
}
|
|
1302
|
+
async readDatasetSharedSchema(datasetId, datasetName) {
|
|
1303
|
+
if (!datasetId && !datasetName) {
|
|
1304
|
+
throw new Error("Either datasetId or datasetName must be given");
|
|
1305
|
+
}
|
|
1306
|
+
if (!datasetId) {
|
|
1307
|
+
const dataset = await this.readDataset({ datasetName });
|
|
1308
|
+
datasetId = dataset.id;
|
|
1309
|
+
}
|
|
1310
|
+
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1311
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1312
|
+
method: "GET",
|
|
1313
|
+
headers: this.headers,
|
|
1314
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1315
|
+
...this.fetchOptions,
|
|
1316
|
+
});
|
|
1317
|
+
const shareSchema = await response.json();
|
|
1318
|
+
shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
|
|
1319
|
+
return shareSchema;
|
|
1320
|
+
}
|
|
1321
|
+
async shareDataset(datasetId, datasetName) {
|
|
1322
|
+
if (!datasetId && !datasetName) {
|
|
1323
|
+
throw new Error("Either datasetId or datasetName must be given");
|
|
1324
|
+
}
|
|
1325
|
+
if (!datasetId) {
|
|
1326
|
+
const dataset = await this.readDataset({ datasetName });
|
|
1327
|
+
datasetId = dataset.id;
|
|
1328
|
+
}
|
|
1329
|
+
const data = {
|
|
1330
|
+
dataset_id: datasetId,
|
|
1331
|
+
};
|
|
1332
|
+
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1333
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1334
|
+
method: "PUT",
|
|
1335
|
+
headers: this.headers,
|
|
1336
|
+
body: JSON.stringify(data),
|
|
1337
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1338
|
+
...this.fetchOptions,
|
|
1339
|
+
});
|
|
1340
|
+
const shareSchema = await response.json();
|
|
1341
|
+
shareSchema.url = `${this.getHostUrl()}/public/${shareSchema.share_token}/d`;
|
|
1342
|
+
return shareSchema;
|
|
1343
|
+
}
|
|
1344
|
+
async unshareDataset(datasetId) {
|
|
1345
|
+
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1346
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/share`, {
|
|
1347
|
+
method: "DELETE",
|
|
1348
|
+
headers: this.headers,
|
|
1349
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1350
|
+
...this.fetchOptions,
|
|
1351
|
+
});
|
|
1352
|
+
await (0, error_js_1.raiseForStatus)(response, "unshare dataset", true);
|
|
1353
|
+
}
|
|
1354
|
+
async readSharedDataset(shareToken) {
|
|
1355
|
+
(0, _uuid_js_1.assertUuid)(shareToken);
|
|
1356
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/public/${shareToken}/datasets`, {
|
|
1357
|
+
method: "GET",
|
|
1358
|
+
headers: this.headers,
|
|
1359
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1360
|
+
...this.fetchOptions,
|
|
1361
|
+
});
|
|
1362
|
+
const dataset = await response.json();
|
|
1363
|
+
return dataset;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* Get shared examples.
|
|
1367
|
+
*
|
|
1368
|
+
* @param {string} shareToken The share token to get examples for. A share token is the UUID (or LangSmith URL, including UUID) generated when explicitly marking an example as public.
|
|
1369
|
+
* @param {Object} [options] Additional options for listing the examples.
|
|
1370
|
+
* @param {string[] | undefined} [options.exampleIds] A list of example IDs to filter by.
|
|
1371
|
+
* @returns {Promise<Example[]>} The shared examples.
|
|
1372
|
+
*/
|
|
1373
|
+
async listSharedExamples(shareToken, options) {
|
|
1374
|
+
const params = {};
|
|
1375
|
+
if (options?.exampleIds) {
|
|
1376
|
+
params.id = options.exampleIds;
|
|
1377
|
+
}
|
|
1378
|
+
const urlParams = new URLSearchParams();
|
|
1379
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
1380
|
+
if (Array.isArray(value)) {
|
|
1381
|
+
value.forEach((v) => urlParams.append(key, v));
|
|
1382
|
+
}
|
|
1383
|
+
else {
|
|
1384
|
+
urlParams.append(key, value);
|
|
1385
|
+
}
|
|
1386
|
+
});
|
|
1387
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/public/${shareToken}/examples?${urlParams.toString()}`, {
|
|
1388
|
+
method: "GET",
|
|
1389
|
+
headers: this.headers,
|
|
1390
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1391
|
+
...this.fetchOptions,
|
|
1392
|
+
});
|
|
1393
|
+
const result = await response.json();
|
|
1394
|
+
if (!response.ok) {
|
|
1395
|
+
if ("detail" in result) {
|
|
1396
|
+
throw new Error(`Failed to list shared examples.\nStatus: ${response.status}\nMessage: ${result.detail.join("\n")}`);
|
|
1397
|
+
}
|
|
1398
|
+
throw new Error(`Failed to list shared examples: ${response.status} ${response.statusText}`);
|
|
1399
|
+
}
|
|
1400
|
+
return result.map((example) => ({
|
|
1401
|
+
...example,
|
|
1402
|
+
_hostUrl: this.getHostUrl(),
|
|
1403
|
+
}));
|
|
1404
|
+
}
|
|
1405
|
+
async createProject({ projectName, description = null, metadata = null, upsert = false, projectExtra = null, referenceDatasetId = null, }) {
|
|
1406
|
+
const upsert_ = upsert ? `?upsert=true` : "";
|
|
1407
|
+
const endpoint = `${this.apiUrl}/sessions${upsert_}`;
|
|
1408
|
+
const extra = projectExtra || {};
|
|
1409
|
+
if (metadata) {
|
|
1410
|
+
extra["metadata"] = metadata;
|
|
1411
|
+
}
|
|
1412
|
+
const body = {
|
|
1413
|
+
name: projectName,
|
|
1414
|
+
extra,
|
|
1415
|
+
description,
|
|
1416
|
+
};
|
|
1417
|
+
if (referenceDatasetId !== null) {
|
|
1418
|
+
body["reference_dataset_id"] = referenceDatasetId;
|
|
1419
|
+
}
|
|
1420
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), endpoint, {
|
|
1421
|
+
method: "POST",
|
|
1422
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1423
|
+
body: JSON.stringify(body),
|
|
1424
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1425
|
+
...this.fetchOptions,
|
|
1426
|
+
});
|
|
1427
|
+
await (0, error_js_1.raiseForStatus)(response, "create project");
|
|
1428
|
+
const result = await response.json();
|
|
1429
|
+
return result;
|
|
1430
|
+
}
|
|
1431
|
+
async updateProject(projectId, { name = null, description = null, metadata = null, projectExtra = null, endTime = null, }) {
|
|
1432
|
+
const endpoint = `${this.apiUrl}/sessions/${projectId}`;
|
|
1433
|
+
let extra = projectExtra;
|
|
1434
|
+
if (metadata) {
|
|
1435
|
+
extra = { ...(extra || {}), metadata };
|
|
1436
|
+
}
|
|
1437
|
+
const body = {
|
|
1438
|
+
name,
|
|
1439
|
+
extra,
|
|
1440
|
+
description,
|
|
1441
|
+
end_time: endTime ? new Date(endTime).toISOString() : null,
|
|
1442
|
+
};
|
|
1443
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), endpoint, {
|
|
1444
|
+
method: "PATCH",
|
|
1445
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1446
|
+
body: JSON.stringify(body),
|
|
1447
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1448
|
+
...this.fetchOptions,
|
|
1449
|
+
});
|
|
1450
|
+
await (0, error_js_1.raiseForStatus)(response, "update project");
|
|
1451
|
+
const result = await response.json();
|
|
1452
|
+
return result;
|
|
1453
|
+
}
|
|
1454
|
+
async hasProject({ projectId, projectName, }) {
|
|
1455
|
+
// TODO: Add a head request
|
|
1456
|
+
let path = "/sessions";
|
|
1457
|
+
const params = new URLSearchParams();
|
|
1458
|
+
if (projectId !== undefined && projectName !== undefined) {
|
|
1459
|
+
throw new Error("Must provide either projectName or projectId, not both");
|
|
1460
|
+
}
|
|
1461
|
+
else if (projectId !== undefined) {
|
|
1462
|
+
(0, _uuid_js_1.assertUuid)(projectId);
|
|
1463
|
+
path += `/${projectId}`;
|
|
1464
|
+
}
|
|
1465
|
+
else if (projectName !== undefined) {
|
|
1466
|
+
params.append("name", projectName);
|
|
1467
|
+
}
|
|
1468
|
+
else {
|
|
1469
|
+
throw new Error("Must provide projectName or projectId");
|
|
1470
|
+
}
|
|
1471
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}${path}?${params}`, {
|
|
1472
|
+
method: "GET",
|
|
1473
|
+
headers: this.headers,
|
|
1474
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1475
|
+
...this.fetchOptions,
|
|
1476
|
+
});
|
|
1477
|
+
// consume the response body to release the connection
|
|
1478
|
+
// https://undici.nodejs.org/#/?id=garbage-collection
|
|
1479
|
+
try {
|
|
1480
|
+
const result = await response.json();
|
|
1481
|
+
if (!response.ok) {
|
|
1482
|
+
return false;
|
|
1483
|
+
}
|
|
1484
|
+
// If it's OK and we're querying by name, need to check the list is not empty
|
|
1485
|
+
if (Array.isArray(result)) {
|
|
1486
|
+
return result.length > 0;
|
|
1487
|
+
}
|
|
1488
|
+
// projectId querying
|
|
1489
|
+
return true;
|
|
1490
|
+
}
|
|
1491
|
+
catch (e) {
|
|
1492
|
+
return false;
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
async readProject({ projectId, projectName, includeStats, }) {
|
|
1496
|
+
let path = "/sessions";
|
|
1497
|
+
const params = new URLSearchParams();
|
|
1498
|
+
if (projectId !== undefined && projectName !== undefined) {
|
|
1499
|
+
throw new Error("Must provide either projectName or projectId, not both");
|
|
1500
|
+
}
|
|
1501
|
+
else if (projectId !== undefined) {
|
|
1502
|
+
(0, _uuid_js_1.assertUuid)(projectId);
|
|
1503
|
+
path += `/${projectId}`;
|
|
1504
|
+
}
|
|
1505
|
+
else if (projectName !== undefined) {
|
|
1506
|
+
params.append("name", projectName);
|
|
1507
|
+
}
|
|
1508
|
+
else {
|
|
1509
|
+
throw new Error("Must provide projectName or projectId");
|
|
1510
|
+
}
|
|
1511
|
+
if (includeStats !== undefined) {
|
|
1512
|
+
params.append("include_stats", includeStats.toString());
|
|
1513
|
+
}
|
|
1514
|
+
const response = await this._get(path, params);
|
|
1515
|
+
let result;
|
|
1516
|
+
if (Array.isArray(response)) {
|
|
1517
|
+
if (response.length === 0) {
|
|
1518
|
+
throw new Error(`Project[id=${projectId}, name=${projectName}] not found`);
|
|
1519
|
+
}
|
|
1520
|
+
result = response[0];
|
|
1521
|
+
}
|
|
1522
|
+
else {
|
|
1523
|
+
result = response;
|
|
1524
|
+
}
|
|
1525
|
+
return result;
|
|
1526
|
+
}
|
|
1527
|
+
async getProjectUrl({ projectId, projectName, }) {
|
|
1528
|
+
if (projectId === undefined && projectName === undefined) {
|
|
1529
|
+
throw new Error("Must provide either projectName or projectId");
|
|
1530
|
+
}
|
|
1531
|
+
const project = await this.readProject({ projectId, projectName });
|
|
1532
|
+
const tenantId = await this._getTenantId();
|
|
1533
|
+
return `${this.getHostUrl()}/o/${tenantId}/projects/p/${project.id}`;
|
|
1534
|
+
}
|
|
1535
|
+
async getDatasetUrl({ datasetId, datasetName, }) {
|
|
1536
|
+
if (datasetId === undefined && datasetName === undefined) {
|
|
1537
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1538
|
+
}
|
|
1539
|
+
const dataset = await this.readDataset({ datasetId, datasetName });
|
|
1540
|
+
const tenantId = await this._getTenantId();
|
|
1541
|
+
return `${this.getHostUrl()}/o/${tenantId}/datasets/${dataset.id}`;
|
|
1542
|
+
}
|
|
1543
|
+
async _getTenantId() {
|
|
1544
|
+
if (this._tenantId !== null) {
|
|
1545
|
+
return this._tenantId;
|
|
1546
|
+
}
|
|
1547
|
+
const queryParams = new URLSearchParams({ limit: "1" });
|
|
1548
|
+
for await (const projects of this._getPaginated("/sessions", queryParams)) {
|
|
1549
|
+
this._tenantId = projects[0].tenant_id;
|
|
1550
|
+
return projects[0].tenant_id;
|
|
1551
|
+
}
|
|
1552
|
+
throw new Error("No projects found to resolve tenant.");
|
|
1553
|
+
}
|
|
1554
|
+
async *listProjects({ projectIds, name, nameContains, referenceDatasetId, referenceDatasetName, referenceFree, metadata, } = {}) {
|
|
1555
|
+
const params = new URLSearchParams();
|
|
1556
|
+
if (projectIds !== undefined) {
|
|
1557
|
+
for (const projectId of projectIds) {
|
|
1558
|
+
params.append("id", projectId);
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
if (name !== undefined) {
|
|
1562
|
+
params.append("name", name);
|
|
1563
|
+
}
|
|
1564
|
+
if (nameContains !== undefined) {
|
|
1565
|
+
params.append("name_contains", nameContains);
|
|
1566
|
+
}
|
|
1567
|
+
if (referenceDatasetId !== undefined) {
|
|
1568
|
+
params.append("reference_dataset", referenceDatasetId);
|
|
1569
|
+
}
|
|
1570
|
+
else if (referenceDatasetName !== undefined) {
|
|
1571
|
+
const dataset = await this.readDataset({
|
|
1572
|
+
datasetName: referenceDatasetName,
|
|
1573
|
+
});
|
|
1574
|
+
params.append("reference_dataset", dataset.id);
|
|
1575
|
+
}
|
|
1576
|
+
if (referenceFree !== undefined) {
|
|
1577
|
+
params.append("reference_free", referenceFree.toString());
|
|
1578
|
+
}
|
|
1579
|
+
if (metadata !== undefined) {
|
|
1580
|
+
params.append("metadata", JSON.stringify(metadata));
|
|
1581
|
+
}
|
|
1582
|
+
for await (const projects of this._getPaginated("/sessions", params)) {
|
|
1583
|
+
yield* projects;
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
async deleteProject({ projectId, projectName, }) {
|
|
1587
|
+
let projectId_;
|
|
1588
|
+
if (projectId === undefined && projectName === undefined) {
|
|
1589
|
+
throw new Error("Must provide projectName or projectId");
|
|
1590
|
+
}
|
|
1591
|
+
else if (projectId !== undefined && projectName !== undefined) {
|
|
1592
|
+
throw new Error("Must provide either projectName or projectId, not both");
|
|
1593
|
+
}
|
|
1594
|
+
else if (projectId === undefined) {
|
|
1595
|
+
projectId_ = (await this.readProject({ projectName })).id;
|
|
1596
|
+
}
|
|
1597
|
+
else {
|
|
1598
|
+
projectId_ = projectId;
|
|
1599
|
+
}
|
|
1600
|
+
(0, _uuid_js_1.assertUuid)(projectId_);
|
|
1601
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/sessions/${projectId_}`, {
|
|
1602
|
+
method: "DELETE",
|
|
1603
|
+
headers: this.headers,
|
|
1604
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1605
|
+
...this.fetchOptions,
|
|
1606
|
+
});
|
|
1607
|
+
await (0, error_js_1.raiseForStatus)(response, `delete session ${projectId_} (${projectName})`, true);
|
|
1608
|
+
}
|
|
1609
|
+
async uploadCsv({ csvFile, fileName, inputKeys, outputKeys, description, dataType, name, }) {
|
|
1610
|
+
const url = `${this.apiUrl}/datasets/upload`;
|
|
1611
|
+
const formData = new FormData();
|
|
1612
|
+
formData.append("file", csvFile, fileName);
|
|
1613
|
+
inputKeys.forEach((key) => {
|
|
1614
|
+
formData.append("input_keys", key);
|
|
1615
|
+
});
|
|
1616
|
+
outputKeys.forEach((key) => {
|
|
1617
|
+
formData.append("output_keys", key);
|
|
1618
|
+
});
|
|
1619
|
+
if (description) {
|
|
1620
|
+
formData.append("description", description);
|
|
1621
|
+
}
|
|
1622
|
+
if (dataType) {
|
|
1623
|
+
formData.append("data_type", dataType);
|
|
1624
|
+
}
|
|
1625
|
+
if (name) {
|
|
1626
|
+
formData.append("name", name);
|
|
1627
|
+
}
|
|
1628
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
|
|
1629
|
+
method: "POST",
|
|
1630
|
+
headers: this.headers,
|
|
1631
|
+
body: formData,
|
|
1632
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1633
|
+
...this.fetchOptions,
|
|
1634
|
+
});
|
|
1635
|
+
await (0, error_js_1.raiseForStatus)(response, "upload CSV");
|
|
1636
|
+
const result = await response.json();
|
|
1637
|
+
return result;
|
|
1638
|
+
}
|
|
1639
|
+
async createDataset(name, { description, dataType, inputsSchema, outputsSchema, metadata, } = {}) {
|
|
1640
|
+
const body = {
|
|
1641
|
+
name,
|
|
1642
|
+
description,
|
|
1643
|
+
extra: metadata ? { metadata } : undefined,
|
|
1644
|
+
};
|
|
1645
|
+
if (dataType) {
|
|
1646
|
+
body.data_type = dataType;
|
|
1647
|
+
}
|
|
1648
|
+
if (inputsSchema) {
|
|
1649
|
+
body.inputs_schema_definition = inputsSchema;
|
|
1650
|
+
}
|
|
1651
|
+
if (outputsSchema) {
|
|
1652
|
+
body.outputs_schema_definition = outputsSchema;
|
|
1653
|
+
}
|
|
1654
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets`, {
|
|
1655
|
+
method: "POST",
|
|
1656
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1657
|
+
body: JSON.stringify(body),
|
|
1658
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1659
|
+
...this.fetchOptions,
|
|
1660
|
+
});
|
|
1661
|
+
await (0, error_js_1.raiseForStatus)(response, "create dataset");
|
|
1662
|
+
const result = await response.json();
|
|
1663
|
+
return result;
|
|
1664
|
+
}
|
|
1665
|
+
async readDataset({ datasetId, datasetName, }) {
|
|
1666
|
+
let path = "/datasets";
|
|
1667
|
+
// limit to 1 result
|
|
1668
|
+
const params = new URLSearchParams({ limit: "1" });
|
|
1669
|
+
if (datasetId !== undefined && datasetName !== undefined) {
|
|
1670
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1671
|
+
}
|
|
1672
|
+
else if (datasetId !== undefined) {
|
|
1673
|
+
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1674
|
+
path += `/${datasetId}`;
|
|
1675
|
+
}
|
|
1676
|
+
else if (datasetName !== undefined) {
|
|
1677
|
+
params.append("name", datasetName);
|
|
1678
|
+
}
|
|
1679
|
+
else {
|
|
1680
|
+
throw new Error("Must provide datasetName or datasetId");
|
|
1681
|
+
}
|
|
1682
|
+
const response = await this._get(path, params);
|
|
1683
|
+
let result;
|
|
1684
|
+
if (Array.isArray(response)) {
|
|
1685
|
+
if (response.length === 0) {
|
|
1686
|
+
throw new Error(`Dataset[id=${datasetId}, name=${datasetName}] not found`);
|
|
1687
|
+
}
|
|
1688
|
+
result = response[0];
|
|
1689
|
+
}
|
|
1690
|
+
else {
|
|
1691
|
+
result = response;
|
|
1692
|
+
}
|
|
1693
|
+
return result;
|
|
1694
|
+
}
|
|
1695
|
+
async hasDataset({ datasetId, datasetName, }) {
|
|
1696
|
+
try {
|
|
1697
|
+
await this.readDataset({ datasetId, datasetName });
|
|
1698
|
+
return true;
|
|
1699
|
+
}
|
|
1700
|
+
catch (e) {
|
|
1701
|
+
if (
|
|
1702
|
+
// eslint-disable-next-line no-instanceof/no-instanceof
|
|
1703
|
+
e instanceof Error &&
|
|
1704
|
+
e.message.toLocaleLowerCase().includes("not found")) {
|
|
1705
|
+
return false;
|
|
1706
|
+
}
|
|
1707
|
+
throw e;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
async diffDatasetVersions({ datasetId, datasetName, fromVersion, toVersion, }) {
|
|
1711
|
+
let datasetId_ = datasetId;
|
|
1712
|
+
if (datasetId_ === undefined && datasetName === undefined) {
|
|
1713
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1714
|
+
}
|
|
1715
|
+
else if (datasetId_ !== undefined && datasetName !== undefined) {
|
|
1716
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1717
|
+
}
|
|
1718
|
+
else if (datasetId_ === undefined) {
|
|
1719
|
+
const dataset = await this.readDataset({ datasetName });
|
|
1720
|
+
datasetId_ = dataset.id;
|
|
1721
|
+
}
|
|
1722
|
+
const urlParams = new URLSearchParams({
|
|
1723
|
+
from_version: typeof fromVersion === "string"
|
|
1724
|
+
? fromVersion
|
|
1725
|
+
: fromVersion.toISOString(),
|
|
1726
|
+
to_version: typeof toVersion === "string" ? toVersion : toVersion.toISOString(),
|
|
1727
|
+
});
|
|
1728
|
+
const response = await this._get(`/datasets/${datasetId_}/versions/diff`, urlParams);
|
|
1729
|
+
return response;
|
|
1730
|
+
}
|
|
1731
|
+
async readDatasetOpenaiFinetuning({ datasetId, datasetName, }) {
|
|
1732
|
+
const path = "/datasets";
|
|
1733
|
+
if (datasetId !== undefined) {
|
|
1734
|
+
// do nothing
|
|
1735
|
+
}
|
|
1736
|
+
else if (datasetName !== undefined) {
|
|
1737
|
+
datasetId = (await this.readDataset({ datasetName })).id;
|
|
1738
|
+
}
|
|
1739
|
+
else {
|
|
1740
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1741
|
+
}
|
|
1742
|
+
const response = await this._getResponse(`${path}/${datasetId}/openai_ft`);
|
|
1743
|
+
const datasetText = await response.text();
|
|
1744
|
+
const dataset = datasetText
|
|
1745
|
+
.trim()
|
|
1746
|
+
.split("\n")
|
|
1747
|
+
.map((line) => JSON.parse(line));
|
|
1748
|
+
return dataset;
|
|
1749
|
+
}
|
|
1750
|
+
async *listDatasets({ limit = 100, offset = 0, datasetIds, datasetName, datasetNameContains, metadata, } = {}) {
|
|
1751
|
+
const path = "/datasets";
|
|
1752
|
+
const params = new URLSearchParams({
|
|
1753
|
+
limit: limit.toString(),
|
|
1754
|
+
offset: offset.toString(),
|
|
1755
|
+
});
|
|
1756
|
+
if (datasetIds !== undefined) {
|
|
1757
|
+
for (const id_ of datasetIds) {
|
|
1758
|
+
params.append("id", id_);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
if (datasetName !== undefined) {
|
|
1762
|
+
params.append("name", datasetName);
|
|
1763
|
+
}
|
|
1764
|
+
if (datasetNameContains !== undefined) {
|
|
1765
|
+
params.append("name_contains", datasetNameContains);
|
|
1766
|
+
}
|
|
1767
|
+
if (metadata !== undefined) {
|
|
1768
|
+
params.append("metadata", JSON.stringify(metadata));
|
|
1769
|
+
}
|
|
1770
|
+
for await (const datasets of this._getPaginated(path, params)) {
|
|
1771
|
+
yield* datasets;
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* Update a dataset
|
|
1776
|
+
* @param props The dataset details to update
|
|
1777
|
+
* @returns The updated dataset
|
|
1778
|
+
*/
|
|
1779
|
+
async updateDataset(props) {
|
|
1780
|
+
const { datasetId, datasetName, ...update } = props;
|
|
1781
|
+
if (!datasetId && !datasetName) {
|
|
1782
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1783
|
+
}
|
|
1784
|
+
const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
|
|
1785
|
+
(0, _uuid_js_1.assertUuid)(_datasetId);
|
|
1786
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${_datasetId}`, {
|
|
1787
|
+
method: "PATCH",
|
|
1788
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1789
|
+
body: JSON.stringify(update),
|
|
1790
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1791
|
+
...this.fetchOptions,
|
|
1792
|
+
});
|
|
1793
|
+
await (0, error_js_1.raiseForStatus)(response, "update dataset");
|
|
1794
|
+
return (await response.json());
|
|
1795
|
+
}
|
|
1796
|
+
/**
|
|
1797
|
+
* Updates a tag on a dataset.
|
|
1798
|
+
*
|
|
1799
|
+
* If the tag is already assigned to a different version of this dataset,
|
|
1800
|
+
* the tag will be moved to the new version. The as_of parameter is used to
|
|
1801
|
+
* determine which version of the dataset to apply the new tags to.
|
|
1802
|
+
*
|
|
1803
|
+
* It must be an exact version of the dataset to succeed. You can
|
|
1804
|
+
* use the "readDatasetVersion" method to find the exact version
|
|
1805
|
+
* to apply the tags to.
|
|
1806
|
+
* @param params.datasetId The ID of the dataset to update. Must be provided if "datasetName" is not provided.
|
|
1807
|
+
* @param params.datasetName The name of the dataset to update. Must be provided if "datasetId" is not provided.
|
|
1808
|
+
* @param params.asOf The timestamp of the dataset to apply the new tags to.
|
|
1809
|
+
* @param params.tag The new tag to apply to the dataset.
|
|
1810
|
+
*/
|
|
1811
|
+
async updateDatasetTag(props) {
|
|
1812
|
+
const { datasetId, datasetName, asOf, tag } = props;
|
|
1813
|
+
if (!datasetId && !datasetName) {
|
|
1814
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1815
|
+
}
|
|
1816
|
+
const _datasetId = datasetId ?? (await this.readDataset({ datasetName })).id;
|
|
1817
|
+
(0, _uuid_js_1.assertUuid)(_datasetId);
|
|
1818
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${_datasetId}/tags`, {
|
|
1819
|
+
method: "PUT",
|
|
1820
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1821
|
+
body: JSON.stringify({
|
|
1822
|
+
as_of: typeof asOf === "string" ? asOf : asOf.toISOString(),
|
|
1823
|
+
tag,
|
|
1824
|
+
}),
|
|
1825
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1826
|
+
...this.fetchOptions,
|
|
1827
|
+
});
|
|
1828
|
+
await (0, error_js_1.raiseForStatus)(response, "update dataset tags");
|
|
1829
|
+
}
|
|
1830
|
+
async deleteDataset({ datasetId, datasetName, }) {
|
|
1831
|
+
let path = "/datasets";
|
|
1832
|
+
let datasetId_ = datasetId;
|
|
1833
|
+
if (datasetId !== undefined && datasetName !== undefined) {
|
|
1834
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1835
|
+
}
|
|
1836
|
+
else if (datasetName !== undefined) {
|
|
1837
|
+
const dataset = await this.readDataset({ datasetName });
|
|
1838
|
+
datasetId_ = dataset.id;
|
|
1839
|
+
}
|
|
1840
|
+
if (datasetId_ !== undefined) {
|
|
1841
|
+
(0, _uuid_js_1.assertUuid)(datasetId_);
|
|
1842
|
+
path += `/${datasetId_}`;
|
|
1843
|
+
}
|
|
1844
|
+
else {
|
|
1845
|
+
throw new Error("Must provide datasetName or datasetId");
|
|
1846
|
+
}
|
|
1847
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), this.apiUrl + path, {
|
|
1848
|
+
method: "DELETE",
|
|
1849
|
+
headers: this.headers,
|
|
1850
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1851
|
+
...this.fetchOptions,
|
|
1852
|
+
});
|
|
1853
|
+
await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
|
|
1854
|
+
await response.json();
|
|
1855
|
+
}
|
|
1856
|
+
async indexDataset({ datasetId, datasetName, tag, }) {
|
|
1857
|
+
let datasetId_ = datasetId;
|
|
1858
|
+
if (!datasetId_ && !datasetName) {
|
|
1859
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1860
|
+
}
|
|
1861
|
+
else if (datasetId_ && datasetName) {
|
|
1862
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1863
|
+
}
|
|
1864
|
+
else if (!datasetId_) {
|
|
1865
|
+
const dataset = await this.readDataset({ datasetName });
|
|
1866
|
+
datasetId_ = dataset.id;
|
|
1867
|
+
}
|
|
1868
|
+
(0, _uuid_js_1.assertUuid)(datasetId_);
|
|
1869
|
+
const data = {
|
|
1870
|
+
tag: tag,
|
|
1871
|
+
};
|
|
1872
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId_}/index`, {
|
|
1873
|
+
method: "POST",
|
|
1874
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1875
|
+
body: JSON.stringify(data),
|
|
1876
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1877
|
+
...this.fetchOptions,
|
|
1878
|
+
});
|
|
1879
|
+
await (0, error_js_1.raiseForStatus)(response, "index dataset");
|
|
1880
|
+
await response.json();
|
|
1881
|
+
}
|
|
1882
|
+
/**
|
|
1883
|
+
* Lets you run a similarity search query on a dataset.
|
|
1884
|
+
*
|
|
1885
|
+
* Requires the dataset to be indexed. Please see the `indexDataset` method to set up indexing.
|
|
1886
|
+
*
|
|
1887
|
+
* @param inputs The input on which to run the similarity search. Must have the
|
|
1888
|
+
* same schema as the dataset.
|
|
1889
|
+
*
|
|
1890
|
+
* @param datasetId The dataset to search for similar examples.
|
|
1891
|
+
*
|
|
1892
|
+
* @param limit The maximum number of examples to return. Will return the top `limit` most
|
|
1893
|
+
* similar examples in order of most similar to least similar. If no similar
|
|
1894
|
+
* examples are found, random examples will be returned.
|
|
1895
|
+
*
|
|
1896
|
+
* @param filter A filter string to apply to the search. Only examples will be returned that
|
|
1897
|
+
* match the filter string. Some examples of filters
|
|
1898
|
+
*
|
|
1899
|
+
* - eq(metadata.mykey, "value")
|
|
1900
|
+
* - and(neq(metadata.my.nested.key, "value"), neq(metadata.mykey, "value"))
|
|
1901
|
+
* - or(eq(metadata.mykey, "value"), eq(metadata.mykey, "othervalue"))
|
|
1902
|
+
*
|
|
1903
|
+
* @returns A list of similar examples.
|
|
1904
|
+
*
|
|
1905
|
+
*
|
|
1906
|
+
* @example
|
|
1907
|
+
* dataset_id = "123e4567-e89b-12d3-a456-426614174000"
|
|
1908
|
+
* inputs = {"text": "How many people live in Berlin?"}
|
|
1909
|
+
* limit = 5
|
|
1910
|
+
* examples = await client.similarExamples(inputs, dataset_id, limit)
|
|
1911
|
+
*/
|
|
1912
|
+
async similarExamples(inputs, datasetId, limit, { filter, } = {}) {
|
|
1913
|
+
const data = {
|
|
1914
|
+
limit: limit,
|
|
1915
|
+
inputs: inputs,
|
|
1916
|
+
};
|
|
1917
|
+
if (filter !== undefined) {
|
|
1918
|
+
data["filter"] = filter;
|
|
1919
|
+
}
|
|
1920
|
+
(0, _uuid_js_1.assertUuid)(datasetId);
|
|
1921
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId}/search`, {
|
|
1922
|
+
method: "POST",
|
|
1923
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1924
|
+
body: JSON.stringify(data),
|
|
1925
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1926
|
+
...this.fetchOptions,
|
|
1927
|
+
});
|
|
1928
|
+
await (0, error_js_1.raiseForStatus)(response, "fetch similar examples");
|
|
1929
|
+
const result = await response.json();
|
|
1930
|
+
return result["examples"];
|
|
1931
|
+
}
|
|
1932
|
+
async createExample(inputsOrUpdate, outputs, options) {
|
|
1933
|
+
if (isExampleCreate(inputsOrUpdate)) {
|
|
1934
|
+
if (outputs !== undefined || options !== undefined) {
|
|
1935
|
+
throw new Error("Cannot provide outputs or options when using ExampleCreate object");
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
let datasetId_ = outputs ? options?.datasetId : inputsOrUpdate.dataset_id;
|
|
1939
|
+
const datasetName_ = outputs
|
|
1940
|
+
? options?.datasetName
|
|
1941
|
+
: inputsOrUpdate.dataset_name;
|
|
1942
|
+
if (datasetId_ === undefined && datasetName_ === undefined) {
|
|
1943
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1944
|
+
}
|
|
1945
|
+
else if (datasetId_ !== undefined && datasetName_ !== undefined) {
|
|
1946
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1947
|
+
}
|
|
1948
|
+
else if (datasetId_ === undefined) {
|
|
1949
|
+
const dataset = await this.readDataset({ datasetName: datasetName_ });
|
|
1950
|
+
datasetId_ = dataset.id;
|
|
1951
|
+
}
|
|
1952
|
+
const createdAt_ = (outputs ? options?.createdAt : inputsOrUpdate.created_at) || new Date();
|
|
1953
|
+
let data;
|
|
1954
|
+
if (!isExampleCreate(inputsOrUpdate)) {
|
|
1955
|
+
data = {
|
|
1956
|
+
inputs: inputsOrUpdate,
|
|
1957
|
+
outputs,
|
|
1958
|
+
created_at: createdAt_?.toISOString(),
|
|
1959
|
+
id: options?.exampleId,
|
|
1960
|
+
metadata: options?.metadata,
|
|
1961
|
+
split: options?.split,
|
|
1962
|
+
source_run_id: options?.sourceRunId,
|
|
1963
|
+
use_source_run_io: options?.useSourceRunIO,
|
|
1964
|
+
use_source_run_attachments: options?.useSourceRunAttachments,
|
|
1965
|
+
attachments: options?.attachments,
|
|
1966
|
+
};
|
|
1967
|
+
}
|
|
1968
|
+
else {
|
|
1969
|
+
data = inputsOrUpdate;
|
|
1970
|
+
}
|
|
1971
|
+
const response = await this._uploadExamplesMultipart(datasetId_, [data]);
|
|
1972
|
+
const example = await this.readExample(response.example_ids?.[0] ?? uuid.v4());
|
|
1973
|
+
return example;
|
|
1974
|
+
}
|
|
1975
|
+
async createExamples(propsOrUploads) {
|
|
1976
|
+
if (Array.isArray(propsOrUploads)) {
|
|
1977
|
+
if (propsOrUploads.length === 0) {
|
|
1978
|
+
return [];
|
|
1979
|
+
}
|
|
1980
|
+
const uploads = propsOrUploads;
|
|
1981
|
+
let datasetId_ = uploads[0].dataset_id;
|
|
1982
|
+
const datasetName_ = uploads[0].dataset_name;
|
|
1983
|
+
if (datasetId_ === undefined && datasetName_ === undefined) {
|
|
1984
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
1985
|
+
}
|
|
1986
|
+
else if (datasetId_ !== undefined && datasetName_ !== undefined) {
|
|
1987
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
1988
|
+
}
|
|
1989
|
+
else if (datasetId_ === undefined) {
|
|
1990
|
+
const dataset = await this.readDataset({ datasetName: datasetName_ });
|
|
1991
|
+
datasetId_ = dataset.id;
|
|
1992
|
+
}
|
|
1993
|
+
const response = await this._uploadExamplesMultipart(datasetId_, uploads);
|
|
1994
|
+
const examples = await Promise.all(response.example_ids.map((id) => this.readExample(id)));
|
|
1995
|
+
return examples;
|
|
1996
|
+
}
|
|
1997
|
+
const { inputs, outputs, metadata, splits, sourceRunIds, useSourceRunIOs, useSourceRunAttachments, attachments, exampleIds, datasetId, datasetName, } = propsOrUploads;
|
|
1998
|
+
if (inputs === undefined) {
|
|
1999
|
+
throw new Error("Must provide inputs when using legacy parameters");
|
|
2000
|
+
}
|
|
2001
|
+
let datasetId_ = datasetId;
|
|
2002
|
+
const datasetName_ = datasetName;
|
|
2003
|
+
if (datasetId_ === undefined && datasetName_ === undefined) {
|
|
2004
|
+
throw new Error("Must provide either datasetName or datasetId");
|
|
2005
|
+
}
|
|
2006
|
+
else if (datasetId_ !== undefined && datasetName_ !== undefined) {
|
|
2007
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
2008
|
+
}
|
|
2009
|
+
else if (datasetId_ === undefined) {
|
|
2010
|
+
const dataset = await this.readDataset({ datasetName: datasetName_ });
|
|
2011
|
+
datasetId_ = dataset.id;
|
|
2012
|
+
}
|
|
2013
|
+
const formattedExamples = inputs.map((input, idx) => {
|
|
2014
|
+
return {
|
|
2015
|
+
dataset_id: datasetId_,
|
|
2016
|
+
inputs: input,
|
|
2017
|
+
outputs: outputs?.[idx],
|
|
2018
|
+
metadata: metadata?.[idx],
|
|
2019
|
+
split: splits?.[idx],
|
|
2020
|
+
id: exampleIds?.[idx],
|
|
2021
|
+
attachments: attachments?.[idx],
|
|
2022
|
+
source_run_id: sourceRunIds?.[idx],
|
|
2023
|
+
use_source_run_io: useSourceRunIOs?.[idx],
|
|
2024
|
+
use_source_run_attachments: useSourceRunAttachments?.[idx],
|
|
2025
|
+
};
|
|
2026
|
+
});
|
|
2027
|
+
const response = await this._uploadExamplesMultipart(datasetId_, formattedExamples);
|
|
2028
|
+
const examples = await Promise.all(response.example_ids.map((id) => this.readExample(id)));
|
|
2029
|
+
return examples;
|
|
2030
|
+
}
|
|
2031
|
+
async createLLMExample(input, generation, options) {
|
|
2032
|
+
return this.createExample({ input }, { output: generation }, options);
|
|
2033
|
+
}
|
|
2034
|
+
async createChatExample(input, generations, options) {
|
|
2035
|
+
const finalInput = input.map((message) => {
|
|
2036
|
+
if ((0, messages_js_1.isLangChainMessage)(message)) {
|
|
2037
|
+
return (0, messages_js_1.convertLangChainMessageToExample)(message);
|
|
2038
|
+
}
|
|
2039
|
+
return message;
|
|
2040
|
+
});
|
|
2041
|
+
const finalOutput = (0, messages_js_1.isLangChainMessage)(generations)
|
|
2042
|
+
? (0, messages_js_1.convertLangChainMessageToExample)(generations)
|
|
2043
|
+
: generations;
|
|
2044
|
+
return this.createExample({ input: finalInput }, { output: finalOutput }, options);
|
|
2045
|
+
}
|
|
2046
|
+
async readExample(exampleId) {
|
|
2047
|
+
(0, _uuid_js_1.assertUuid)(exampleId);
|
|
2048
|
+
const path = `/examples/${exampleId}`;
|
|
2049
|
+
const rawExample = await this._get(path);
|
|
2050
|
+
const { attachment_urls, ...rest } = rawExample;
|
|
2051
|
+
const example = rest;
|
|
2052
|
+
if (attachment_urls) {
|
|
2053
|
+
example.attachments = Object.entries(attachment_urls).reduce((acc, [key, value]) => {
|
|
2054
|
+
acc[key.slice("attachment.".length)] = {
|
|
2055
|
+
presigned_url: value.presigned_url,
|
|
2056
|
+
mime_type: value.mime_type,
|
|
2057
|
+
};
|
|
2058
|
+
return acc;
|
|
2059
|
+
}, {});
|
|
2060
|
+
}
|
|
2061
|
+
return example;
|
|
2062
|
+
}
|
|
2063
|
+
async *listExamples({ datasetId, datasetName, exampleIds, asOf, splits, inlineS3Urls, metadata, limit, offset, filter, includeAttachments, } = {}) {
|
|
2064
|
+
let datasetId_;
|
|
2065
|
+
if (datasetId !== undefined && datasetName !== undefined) {
|
|
2066
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
2067
|
+
}
|
|
2068
|
+
else if (datasetId !== undefined) {
|
|
2069
|
+
datasetId_ = datasetId;
|
|
2070
|
+
}
|
|
2071
|
+
else if (datasetName !== undefined) {
|
|
2072
|
+
const dataset = await this.readDataset({ datasetName });
|
|
2073
|
+
datasetId_ = dataset.id;
|
|
2074
|
+
}
|
|
2075
|
+
else {
|
|
2076
|
+
throw new Error("Must provide a datasetName or datasetId");
|
|
2077
|
+
}
|
|
2078
|
+
const params = new URLSearchParams({ dataset: datasetId_ });
|
|
2079
|
+
const dataset_version = asOf
|
|
2080
|
+
? typeof asOf === "string"
|
|
2081
|
+
? asOf
|
|
2082
|
+
: asOf?.toISOString()
|
|
2083
|
+
: undefined;
|
|
2084
|
+
if (dataset_version) {
|
|
2085
|
+
params.append("as_of", dataset_version);
|
|
2086
|
+
}
|
|
2087
|
+
const inlineS3Urls_ = inlineS3Urls ?? true;
|
|
2088
|
+
params.append("inline_s3_urls", inlineS3Urls_.toString());
|
|
2089
|
+
if (exampleIds !== undefined) {
|
|
2090
|
+
for (const id_ of exampleIds) {
|
|
2091
|
+
params.append("id", id_);
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
if (splits !== undefined) {
|
|
2095
|
+
for (const split of splits) {
|
|
2096
|
+
params.append("splits", split);
|
|
2097
|
+
}
|
|
2098
|
+
}
|
|
2099
|
+
if (metadata !== undefined) {
|
|
2100
|
+
const serializedMetadata = JSON.stringify(metadata);
|
|
2101
|
+
params.append("metadata", serializedMetadata);
|
|
2102
|
+
}
|
|
2103
|
+
if (limit !== undefined) {
|
|
2104
|
+
params.append("limit", limit.toString());
|
|
2105
|
+
}
|
|
2106
|
+
if (offset !== undefined) {
|
|
2107
|
+
params.append("offset", offset.toString());
|
|
2108
|
+
}
|
|
2109
|
+
if (filter !== undefined) {
|
|
2110
|
+
params.append("filter", filter);
|
|
2111
|
+
}
|
|
2112
|
+
if (includeAttachments === true) {
|
|
2113
|
+
["attachment_urls", "outputs", "metadata"].forEach((field) => params.append("select", field));
|
|
2114
|
+
}
|
|
2115
|
+
let i = 0;
|
|
2116
|
+
for await (const rawExamples of this._getPaginated("/examples", params)) {
|
|
2117
|
+
for (const rawExample of rawExamples) {
|
|
2118
|
+
const { attachment_urls, ...rest } = rawExample;
|
|
2119
|
+
const example = rest;
|
|
2120
|
+
if (attachment_urls) {
|
|
2121
|
+
example.attachments = Object.entries(attachment_urls).reduce((acc, [key, value]) => {
|
|
2122
|
+
acc[key.slice("attachment.".length)] = {
|
|
2123
|
+
presigned_url: value.presigned_url,
|
|
2124
|
+
mime_type: value.mime_type || undefined,
|
|
2125
|
+
};
|
|
2126
|
+
return acc;
|
|
2127
|
+
}, {});
|
|
2128
|
+
}
|
|
2129
|
+
yield example;
|
|
2130
|
+
i++;
|
|
2131
|
+
}
|
|
2132
|
+
if (limit !== undefined && i >= limit) {
|
|
2133
|
+
break;
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
async deleteExample(exampleId) {
|
|
2138
|
+
(0, _uuid_js_1.assertUuid)(exampleId);
|
|
2139
|
+
const path = `/examples/${exampleId}`;
|
|
2140
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), this.apiUrl + path, {
|
|
2141
|
+
method: "DELETE",
|
|
2142
|
+
headers: this.headers,
|
|
2143
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2144
|
+
...this.fetchOptions,
|
|
2145
|
+
});
|
|
2146
|
+
await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
|
|
2147
|
+
await response.json();
|
|
2148
|
+
}
|
|
2149
|
+
async updateExample(exampleIdOrUpdate, update) {
|
|
2150
|
+
let exampleId;
|
|
2151
|
+
if (update) {
|
|
2152
|
+
exampleId = exampleIdOrUpdate;
|
|
2153
|
+
}
|
|
2154
|
+
else {
|
|
2155
|
+
exampleId = exampleIdOrUpdate.id;
|
|
2156
|
+
}
|
|
2157
|
+
(0, _uuid_js_1.assertUuid)(exampleId);
|
|
2158
|
+
let updateToUse;
|
|
2159
|
+
if (update) {
|
|
2160
|
+
updateToUse = { id: exampleId, ...update };
|
|
2161
|
+
}
|
|
2162
|
+
else {
|
|
2163
|
+
updateToUse = exampleIdOrUpdate;
|
|
2164
|
+
}
|
|
2165
|
+
let datasetId;
|
|
2166
|
+
if (updateToUse.dataset_id !== undefined) {
|
|
2167
|
+
datasetId = updateToUse.dataset_id;
|
|
2168
|
+
}
|
|
2169
|
+
else {
|
|
2170
|
+
const example = await this.readExample(exampleId);
|
|
2171
|
+
datasetId = example.dataset_id;
|
|
2172
|
+
}
|
|
2173
|
+
return this._updateExamplesMultipart(datasetId, [updateToUse]);
|
|
2174
|
+
}
|
|
2175
|
+
async updateExamples(update) {
|
|
2176
|
+
// We will naively get dataset id from first example and assume it works for all
|
|
2177
|
+
let datasetId;
|
|
2178
|
+
if (update[0].dataset_id === undefined) {
|
|
2179
|
+
const example = await this.readExample(update[0].id);
|
|
2180
|
+
datasetId = example.dataset_id;
|
|
2181
|
+
}
|
|
2182
|
+
else {
|
|
2183
|
+
datasetId = update[0].dataset_id;
|
|
2184
|
+
}
|
|
2185
|
+
return this._updateExamplesMultipart(datasetId, update);
|
|
2186
|
+
}
|
|
2187
|
+
/**
|
|
2188
|
+
* Get dataset version by closest date or exact tag.
|
|
2189
|
+
*
|
|
2190
|
+
* Use this to resolve the nearest version to a given timestamp or for a given tag.
|
|
2191
|
+
*
|
|
2192
|
+
* @param options The options for getting the dataset version
|
|
2193
|
+
* @param options.datasetId The ID of the dataset
|
|
2194
|
+
* @param options.datasetName The name of the dataset
|
|
2195
|
+
* @param options.asOf The timestamp of the dataset to retrieve
|
|
2196
|
+
* @param options.tag The tag of the dataset to retrieve
|
|
2197
|
+
* @returns The dataset version
|
|
2198
|
+
*/
|
|
2199
|
+
async readDatasetVersion({ datasetId, datasetName, asOf, tag, }) {
|
|
2200
|
+
let resolvedDatasetId;
|
|
2201
|
+
if (!datasetId) {
|
|
2202
|
+
const dataset = await this.readDataset({ datasetName });
|
|
2203
|
+
resolvedDatasetId = dataset.id;
|
|
2204
|
+
}
|
|
2205
|
+
else {
|
|
2206
|
+
resolvedDatasetId = datasetId;
|
|
2207
|
+
}
|
|
2208
|
+
(0, _uuid_js_1.assertUuid)(resolvedDatasetId);
|
|
2209
|
+
if ((asOf && tag) || (!asOf && !tag)) {
|
|
2210
|
+
throw new Error("Exactly one of asOf and tag must be specified.");
|
|
2211
|
+
}
|
|
2212
|
+
const params = new URLSearchParams();
|
|
2213
|
+
if (asOf !== undefined) {
|
|
2214
|
+
params.append("as_of", typeof asOf === "string" ? asOf : asOf.toISOString());
|
|
2215
|
+
}
|
|
2216
|
+
if (tag !== undefined) {
|
|
2217
|
+
params.append("tag", tag);
|
|
2218
|
+
}
|
|
2219
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${resolvedDatasetId}/version?${params.toString()}`, {
|
|
2220
|
+
method: "GET",
|
|
2221
|
+
headers: { ...this.headers },
|
|
2222
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2223
|
+
...this.fetchOptions,
|
|
2224
|
+
});
|
|
2225
|
+
await (0, error_js_1.raiseForStatus)(response, "read dataset version");
|
|
2226
|
+
return await response.json();
|
|
2227
|
+
}
|
|
2228
|
+
async listDatasetSplits({ datasetId, datasetName, asOf, }) {
|
|
2229
|
+
let datasetId_;
|
|
2230
|
+
if (datasetId === undefined && datasetName === undefined) {
|
|
2231
|
+
throw new Error("Must provide dataset name or ID");
|
|
2232
|
+
}
|
|
2233
|
+
else if (datasetId !== undefined && datasetName !== undefined) {
|
|
2234
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
2235
|
+
}
|
|
2236
|
+
else if (datasetId === undefined) {
|
|
2237
|
+
const dataset = await this.readDataset({ datasetName });
|
|
2238
|
+
datasetId_ = dataset.id;
|
|
2239
|
+
}
|
|
2240
|
+
else {
|
|
2241
|
+
datasetId_ = datasetId;
|
|
2242
|
+
}
|
|
2243
|
+
(0, _uuid_js_1.assertUuid)(datasetId_);
|
|
2244
|
+
const params = new URLSearchParams();
|
|
2245
|
+
const dataset_version = asOf
|
|
2246
|
+
? typeof asOf === "string"
|
|
2247
|
+
? asOf
|
|
2248
|
+
: asOf?.toISOString()
|
|
2249
|
+
: undefined;
|
|
2250
|
+
if (dataset_version) {
|
|
2251
|
+
params.append("as_of", dataset_version);
|
|
2252
|
+
}
|
|
2253
|
+
const response = await this._get(`/datasets/${datasetId_}/splits`, params);
|
|
2254
|
+
return response;
|
|
2255
|
+
}
|
|
2256
|
+
async updateDatasetSplits({ datasetId, datasetName, splitName, exampleIds, remove = false, }) {
|
|
2257
|
+
let datasetId_;
|
|
2258
|
+
if (datasetId === undefined && datasetName === undefined) {
|
|
2259
|
+
throw new Error("Must provide dataset name or ID");
|
|
2260
|
+
}
|
|
2261
|
+
else if (datasetId !== undefined && datasetName !== undefined) {
|
|
2262
|
+
throw new Error("Must provide either datasetName or datasetId, not both");
|
|
2263
|
+
}
|
|
2264
|
+
else if (datasetId === undefined) {
|
|
2265
|
+
const dataset = await this.readDataset({ datasetName });
|
|
2266
|
+
datasetId_ = dataset.id;
|
|
2267
|
+
}
|
|
2268
|
+
else {
|
|
2269
|
+
datasetId_ = datasetId;
|
|
2270
|
+
}
|
|
2271
|
+
(0, _uuid_js_1.assertUuid)(datasetId_);
|
|
2272
|
+
const data = {
|
|
2273
|
+
split_name: splitName,
|
|
2274
|
+
examples: exampleIds.map((id) => {
|
|
2275
|
+
(0, _uuid_js_1.assertUuid)(id);
|
|
2276
|
+
return id;
|
|
2277
|
+
}),
|
|
2278
|
+
remove,
|
|
2279
|
+
};
|
|
2280
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/${datasetId_}/splits`, {
|
|
2281
|
+
method: "PUT",
|
|
2282
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2283
|
+
body: JSON.stringify(data),
|
|
2284
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2285
|
+
...this.fetchOptions,
|
|
2286
|
+
});
|
|
2287
|
+
await (0, error_js_1.raiseForStatus)(response, "update dataset splits", true);
|
|
2288
|
+
}
|
|
2289
|
+
/**
|
|
2290
|
+
* @deprecated This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.
|
|
2291
|
+
*/
|
|
2292
|
+
async evaluateRun(run, evaluator, { sourceInfo, loadChildRuns, referenceExample, } = { loadChildRuns: false }) {
|
|
2293
|
+
(0, warn_js_1.warnOnce)("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");
|
|
2294
|
+
let run_;
|
|
2295
|
+
if (typeof run === "string") {
|
|
2296
|
+
run_ = await this.readRun(run, { loadChildRuns });
|
|
2297
|
+
}
|
|
2298
|
+
else if (typeof run === "object" && "id" in run) {
|
|
2299
|
+
run_ = run;
|
|
2300
|
+
}
|
|
2301
|
+
else {
|
|
2302
|
+
throw new Error(`Invalid run type: ${typeof run}`);
|
|
2303
|
+
}
|
|
2304
|
+
if (run_.reference_example_id !== null &&
|
|
2305
|
+
run_.reference_example_id !== undefined) {
|
|
2306
|
+
referenceExample = await this.readExample(run_.reference_example_id);
|
|
2307
|
+
}
|
|
2308
|
+
const feedbackResult = await evaluator.evaluateRun(run_, referenceExample);
|
|
2309
|
+
const [_, feedbacks] = await this._logEvaluationFeedback(feedbackResult, run_, sourceInfo);
|
|
2310
|
+
return feedbacks[0];
|
|
2311
|
+
}
|
|
2312
|
+
async createFeedback(runId, key, { score, value, correction, comment, sourceInfo, feedbackSourceType = "api", sourceRunId, feedbackId, feedbackConfig, projectId, comparativeExperimentId, }) {
|
|
2313
|
+
if (!runId && !projectId) {
|
|
2314
|
+
throw new Error("One of runId or projectId must be provided");
|
|
2315
|
+
}
|
|
2316
|
+
if (runId && projectId) {
|
|
2317
|
+
throw new Error("Only one of runId or projectId can be provided");
|
|
2318
|
+
}
|
|
2319
|
+
const feedback_source = {
|
|
2320
|
+
type: feedbackSourceType ?? "api",
|
|
2321
|
+
metadata: sourceInfo ?? {},
|
|
2322
|
+
};
|
|
2323
|
+
if (sourceRunId !== undefined &&
|
|
2324
|
+
feedback_source?.metadata !== undefined &&
|
|
2325
|
+
!feedback_source.metadata["__run"]) {
|
|
2326
|
+
feedback_source.metadata["__run"] = { run_id: sourceRunId };
|
|
2327
|
+
}
|
|
2328
|
+
if (feedback_source?.metadata !== undefined &&
|
|
2329
|
+
feedback_source.metadata["__run"]?.run_id !== undefined) {
|
|
2330
|
+
(0, _uuid_js_1.assertUuid)(feedback_source.metadata["__run"].run_id);
|
|
2331
|
+
}
|
|
2332
|
+
const feedback = {
|
|
2333
|
+
id: feedbackId ?? uuid.v4(),
|
|
2334
|
+
run_id: runId,
|
|
2335
|
+
key,
|
|
2336
|
+
score,
|
|
2337
|
+
value,
|
|
2338
|
+
correction,
|
|
2339
|
+
comment,
|
|
2340
|
+
feedback_source: feedback_source,
|
|
2341
|
+
comparative_experiment_id: comparativeExperimentId,
|
|
2342
|
+
feedbackConfig,
|
|
2343
|
+
session_id: projectId,
|
|
2344
|
+
};
|
|
2345
|
+
const url = `${this.apiUrl}/feedback`;
|
|
2346
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), url, {
|
|
2347
|
+
method: "POST",
|
|
2348
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2349
|
+
body: JSON.stringify(feedback),
|
|
2350
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2351
|
+
...this.fetchOptions,
|
|
2352
|
+
});
|
|
2353
|
+
await (0, error_js_1.raiseForStatus)(response, "create feedback", true);
|
|
2354
|
+
return feedback;
|
|
2355
|
+
}
|
|
2356
|
+
async updateFeedback(feedbackId, { score, value, correction, comment, }) {
|
|
2357
|
+
const feedbackUpdate = {};
|
|
2358
|
+
if (score !== undefined && score !== null) {
|
|
2359
|
+
feedbackUpdate["score"] = score;
|
|
2360
|
+
}
|
|
2361
|
+
if (value !== undefined && value !== null) {
|
|
2362
|
+
feedbackUpdate["value"] = value;
|
|
2363
|
+
}
|
|
2364
|
+
if (correction !== undefined && correction !== null) {
|
|
2365
|
+
feedbackUpdate["correction"] = correction;
|
|
2366
|
+
}
|
|
2367
|
+
if (comment !== undefined && comment !== null) {
|
|
2368
|
+
feedbackUpdate["comment"] = comment;
|
|
2369
|
+
}
|
|
2370
|
+
(0, _uuid_js_1.assertUuid)(feedbackId);
|
|
2371
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/feedback/${feedbackId}`, {
|
|
2372
|
+
method: "PATCH",
|
|
2373
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2374
|
+
body: JSON.stringify(feedbackUpdate),
|
|
2375
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2376
|
+
...this.fetchOptions,
|
|
2377
|
+
});
|
|
2378
|
+
await (0, error_js_1.raiseForStatus)(response, "update feedback", true);
|
|
2379
|
+
}
|
|
2380
|
+
async readFeedback(feedbackId) {
|
|
2381
|
+
(0, _uuid_js_1.assertUuid)(feedbackId);
|
|
2382
|
+
const path = `/feedback/${feedbackId}`;
|
|
2383
|
+
const response = await this._get(path);
|
|
2384
|
+
return response;
|
|
2385
|
+
}
|
|
2386
|
+
async deleteFeedback(feedbackId) {
|
|
2387
|
+
(0, _uuid_js_1.assertUuid)(feedbackId);
|
|
2388
|
+
const path = `/feedback/${feedbackId}`;
|
|
2389
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), this.apiUrl + path, {
|
|
2390
|
+
method: "DELETE",
|
|
2391
|
+
headers: this.headers,
|
|
2392
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2393
|
+
...this.fetchOptions,
|
|
2394
|
+
});
|
|
2395
|
+
await (0, error_js_1.raiseForStatus)(response, `delete ${path}`);
|
|
2396
|
+
await response.json();
|
|
2397
|
+
}
|
|
2398
|
+
async *listFeedback({ runIds, feedbackKeys, feedbackSourceTypes, } = {}) {
|
|
2399
|
+
const queryParams = new URLSearchParams();
|
|
2400
|
+
if (runIds) {
|
|
2401
|
+
queryParams.append("run", runIds.join(","));
|
|
2402
|
+
}
|
|
2403
|
+
if (feedbackKeys) {
|
|
2404
|
+
for (const key of feedbackKeys) {
|
|
2405
|
+
queryParams.append("key", key);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
if (feedbackSourceTypes) {
|
|
2409
|
+
for (const type of feedbackSourceTypes) {
|
|
2410
|
+
queryParams.append("source", type);
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
for await (const feedbacks of this._getPaginated("/feedback", queryParams)) {
|
|
2414
|
+
yield* feedbacks;
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
/**
|
|
2418
|
+
* Creates a presigned feedback token and URL.
|
|
2419
|
+
*
|
|
2420
|
+
* The token can be used to authorize feedback metrics without
|
|
2421
|
+
* needing an API key. This is useful for giving browser-based
|
|
2422
|
+
* applications the ability to submit feedback without needing
|
|
2423
|
+
* to expose an API key.
|
|
2424
|
+
*
|
|
2425
|
+
* @param runId The ID of the run.
|
|
2426
|
+
* @param feedbackKey The feedback key.
|
|
2427
|
+
* @param options Additional options for the token.
|
|
2428
|
+
* @param options.expiration The expiration time for the token.
|
|
2429
|
+
*
|
|
2430
|
+
* @returns A promise that resolves to a FeedbackIngestToken.
|
|
2431
|
+
*/
|
|
2432
|
+
async createPresignedFeedbackToken(runId, feedbackKey, { expiration, feedbackConfig, } = {}) {
|
|
2433
|
+
const body = {
|
|
2434
|
+
run_id: runId,
|
|
2435
|
+
feedback_key: feedbackKey,
|
|
2436
|
+
feedback_config: feedbackConfig,
|
|
2437
|
+
};
|
|
2438
|
+
if (expiration) {
|
|
2439
|
+
if (typeof expiration === "string") {
|
|
2440
|
+
body["expires_at"] = expiration;
|
|
2441
|
+
}
|
|
2442
|
+
else if (expiration?.hours || expiration?.minutes || expiration?.days) {
|
|
2443
|
+
body["expires_in"] = expiration;
|
|
2444
|
+
}
|
|
2445
|
+
}
|
|
2446
|
+
else {
|
|
2447
|
+
body["expires_in"] = {
|
|
2448
|
+
hours: 3,
|
|
2449
|
+
};
|
|
2450
|
+
}
|
|
2451
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/feedback/tokens`, {
|
|
2452
|
+
method: "POST",
|
|
2453
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2454
|
+
body: JSON.stringify(body),
|
|
2455
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2456
|
+
...this.fetchOptions,
|
|
2457
|
+
});
|
|
2458
|
+
const result = await response.json();
|
|
2459
|
+
return result;
|
|
2460
|
+
}
|
|
2461
|
+
async createComparativeExperiment({ name, experimentIds, referenceDatasetId, createdAt, description, metadata, id, }) {
|
|
2462
|
+
if (experimentIds.length === 0) {
|
|
2463
|
+
throw new Error("At least one experiment is required");
|
|
2464
|
+
}
|
|
2465
|
+
if (!referenceDatasetId) {
|
|
2466
|
+
referenceDatasetId = (await this.readProject({
|
|
2467
|
+
projectId: experimentIds[0],
|
|
2468
|
+
})).reference_dataset_id;
|
|
2469
|
+
}
|
|
2470
|
+
if (!referenceDatasetId == null) {
|
|
2471
|
+
throw new Error("A reference dataset is required");
|
|
2472
|
+
}
|
|
2473
|
+
const body = {
|
|
2474
|
+
id,
|
|
2475
|
+
name,
|
|
2476
|
+
experiment_ids: experimentIds,
|
|
2477
|
+
reference_dataset_id: referenceDatasetId,
|
|
2478
|
+
description,
|
|
2479
|
+
created_at: (createdAt ?? new Date())?.toISOString(),
|
|
2480
|
+
extra: {},
|
|
2481
|
+
};
|
|
2482
|
+
if (metadata)
|
|
2483
|
+
body.extra["metadata"] = metadata;
|
|
2484
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/datasets/comparative`, {
|
|
2485
|
+
method: "POST",
|
|
2486
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2487
|
+
body: JSON.stringify(body),
|
|
2488
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2489
|
+
...this.fetchOptions,
|
|
2490
|
+
});
|
|
2491
|
+
return await response.json();
|
|
2492
|
+
}
|
|
2493
|
+
/**
|
|
2494
|
+
* Retrieves a list of presigned feedback tokens for a given run ID.
|
|
2495
|
+
* @param runId The ID of the run.
|
|
2496
|
+
* @returns An async iterable of FeedbackIngestToken objects.
|
|
2497
|
+
*/
|
|
2498
|
+
async *listPresignedFeedbackTokens(runId) {
|
|
2499
|
+
(0, _uuid_js_1.assertUuid)(runId);
|
|
2500
|
+
const params = new URLSearchParams({ run_id: runId });
|
|
2501
|
+
for await (const tokens of this._getPaginated("/feedback/tokens", params)) {
|
|
2502
|
+
yield* tokens;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
_selectEvalResults(results) {
|
|
2506
|
+
let results_;
|
|
2507
|
+
if ("results" in results) {
|
|
2508
|
+
results_ = results.results;
|
|
2509
|
+
}
|
|
2510
|
+
else if (Array.isArray(results)) {
|
|
2511
|
+
results_ = results;
|
|
2512
|
+
}
|
|
2513
|
+
else {
|
|
2514
|
+
results_ = [results];
|
|
2515
|
+
}
|
|
2516
|
+
return results_;
|
|
2517
|
+
}
|
|
2518
|
+
async _logEvaluationFeedback(evaluatorResponse, run, sourceInfo) {
|
|
2519
|
+
const evalResults = this._selectEvalResults(evaluatorResponse);
|
|
2520
|
+
const feedbacks = [];
|
|
2521
|
+
for (const res of evalResults) {
|
|
2522
|
+
let sourceInfo_ = sourceInfo || {};
|
|
2523
|
+
if (res.evaluatorInfo) {
|
|
2524
|
+
sourceInfo_ = { ...res.evaluatorInfo, ...sourceInfo_ };
|
|
2525
|
+
}
|
|
2526
|
+
let runId_ = null;
|
|
2527
|
+
if (res.targetRunId) {
|
|
2528
|
+
runId_ = res.targetRunId;
|
|
2529
|
+
}
|
|
2530
|
+
else if (run) {
|
|
2531
|
+
runId_ = run.id;
|
|
2532
|
+
}
|
|
2533
|
+
feedbacks.push(await this.createFeedback(runId_, res.key, {
|
|
2534
|
+
score: res.score,
|
|
2535
|
+
value: res.value,
|
|
2536
|
+
comment: res.comment,
|
|
2537
|
+
correction: res.correction,
|
|
2538
|
+
sourceInfo: sourceInfo_,
|
|
2539
|
+
sourceRunId: res.sourceRunId,
|
|
2540
|
+
feedbackConfig: res.feedbackConfig,
|
|
2541
|
+
feedbackSourceType: "model",
|
|
2542
|
+
}));
|
|
2543
|
+
}
|
|
2544
|
+
return [evalResults, feedbacks];
|
|
2545
|
+
}
|
|
2546
|
+
async logEvaluationFeedback(evaluatorResponse, run, sourceInfo) {
|
|
2547
|
+
const [results] = await this._logEvaluationFeedback(evaluatorResponse, run, sourceInfo);
|
|
2548
|
+
return results;
|
|
2549
|
+
}
|
|
2550
|
+
/**
|
|
2551
|
+
* API for managing annotation queues
|
|
2552
|
+
*/
|
|
2553
|
+
/**
|
|
2554
|
+
* List the annotation queues on the LangSmith API.
|
|
2555
|
+
* @param options - The options for listing annotation queues
|
|
2556
|
+
* @param options.queueIds - The IDs of the queues to filter by
|
|
2557
|
+
* @param options.name - The name of the queue to filter by
|
|
2558
|
+
* @param options.nameContains - The substring that the queue name should contain
|
|
2559
|
+
* @param options.limit - The maximum number of queues to return
|
|
2560
|
+
* @returns An iterator of AnnotationQueue objects
|
|
2561
|
+
*/
|
|
2562
|
+
async *listAnnotationQueues(options = {}) {
|
|
2563
|
+
const { queueIds, name, nameContains, limit } = options;
|
|
2564
|
+
const params = new URLSearchParams();
|
|
2565
|
+
if (queueIds) {
|
|
2566
|
+
queueIds.forEach((id, i) => {
|
|
2567
|
+
(0, _uuid_js_1.assertUuid)(id, `queueIds[${i}]`);
|
|
2568
|
+
params.append("ids", id);
|
|
2569
|
+
});
|
|
2570
|
+
}
|
|
2571
|
+
if (name)
|
|
2572
|
+
params.append("name", name);
|
|
2573
|
+
if (nameContains)
|
|
2574
|
+
params.append("name_contains", nameContains);
|
|
2575
|
+
params.append("limit", (limit !== undefined ? Math.min(limit, 100) : 100).toString());
|
|
2576
|
+
let count = 0;
|
|
2577
|
+
for await (const queues of this._getPaginated("/annotation-queues", params)) {
|
|
2578
|
+
yield* queues;
|
|
2579
|
+
count++;
|
|
2580
|
+
if (limit !== undefined && count >= limit)
|
|
2581
|
+
break;
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* Create an annotation queue on the LangSmith API.
|
|
2586
|
+
* @param options - The options for creating an annotation queue
|
|
2587
|
+
* @param options.name - The name of the annotation queue
|
|
2588
|
+
* @param options.description - The description of the annotation queue
|
|
2589
|
+
* @param options.queueId - The ID of the annotation queue
|
|
2590
|
+
* @returns The created AnnotationQueue object
|
|
2591
|
+
*/
|
|
2592
|
+
async createAnnotationQueue(options) {
|
|
2593
|
+
const { name, description, queueId } = options;
|
|
2594
|
+
const body = {
|
|
2595
|
+
name,
|
|
2596
|
+
description,
|
|
2597
|
+
id: queueId || uuid.v4(),
|
|
2598
|
+
};
|
|
2599
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues`, {
|
|
2600
|
+
method: "POST",
|
|
2601
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2602
|
+
body: JSON.stringify(Object.fromEntries(Object.entries(body).filter(([_, v]) => v !== undefined))),
|
|
2603
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2604
|
+
...this.fetchOptions,
|
|
2605
|
+
});
|
|
2606
|
+
await (0, error_js_1.raiseForStatus)(response, "create annotation queue");
|
|
2607
|
+
const data = await response.json();
|
|
2608
|
+
return data;
|
|
2609
|
+
}
|
|
2610
|
+
/**
|
|
2611
|
+
* Read an annotation queue with the specified queue ID.
|
|
2612
|
+
* @param queueId - The ID of the annotation queue to read
|
|
2613
|
+
* @returns The AnnotationQueue object
|
|
2614
|
+
*/
|
|
2615
|
+
async readAnnotationQueue(queueId) {
|
|
2616
|
+
// TODO: Replace when actual endpoint is added
|
|
2617
|
+
const queueIteratorResult = await this.listAnnotationQueues({
|
|
2618
|
+
queueIds: [queueId],
|
|
2619
|
+
}).next();
|
|
2620
|
+
if (queueIteratorResult.done) {
|
|
2621
|
+
throw new Error(`Annotation queue with ID ${queueId} not found`);
|
|
2622
|
+
}
|
|
2623
|
+
return queueIteratorResult.value;
|
|
2624
|
+
}
|
|
2625
|
+
/**
|
|
2626
|
+
* Update an annotation queue with the specified queue ID.
|
|
2627
|
+
* @param queueId - The ID of the annotation queue to update
|
|
2628
|
+
* @param options - The options for updating the annotation queue
|
|
2629
|
+
* @param options.name - The new name for the annotation queue
|
|
2630
|
+
* @param options.description - The new description for the annotation queue
|
|
2631
|
+
*/
|
|
2632
|
+
async updateAnnotationQueue(queueId, options) {
|
|
2633
|
+
const { name, description } = options;
|
|
2634
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
|
|
2635
|
+
method: "PATCH",
|
|
2636
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2637
|
+
body: JSON.stringify({ name, description }),
|
|
2638
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2639
|
+
...this.fetchOptions,
|
|
2640
|
+
});
|
|
2641
|
+
await (0, error_js_1.raiseForStatus)(response, "update annotation queue");
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* Delete an annotation queue with the specified queue ID.
|
|
2645
|
+
* @param queueId - The ID of the annotation queue to delete
|
|
2646
|
+
*/
|
|
2647
|
+
async deleteAnnotationQueue(queueId) {
|
|
2648
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
|
|
2649
|
+
method: "DELETE",
|
|
2650
|
+
headers: { ...this.headers, Accept: "application/json" },
|
|
2651
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2652
|
+
...this.fetchOptions,
|
|
2653
|
+
});
|
|
2654
|
+
await (0, error_js_1.raiseForStatus)(response, "delete annotation queue");
|
|
2655
|
+
}
|
|
2656
|
+
/**
|
|
2657
|
+
* Add runs to an annotation queue with the specified queue ID.
|
|
2658
|
+
* @param queueId - The ID of the annotation queue
|
|
2659
|
+
* @param runIds - The IDs of the runs to be added to the annotation queue
|
|
2660
|
+
*/
|
|
2661
|
+
async addRunsToAnnotationQueue(queueId, runIds) {
|
|
2662
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs`, {
|
|
2663
|
+
method: "POST",
|
|
2664
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2665
|
+
body: JSON.stringify(runIds.map((id, i) => (0, _uuid_js_1.assertUuid)(id, `runIds[${i}]`).toString())),
|
|
2666
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2667
|
+
...this.fetchOptions,
|
|
2668
|
+
});
|
|
2669
|
+
await (0, error_js_1.raiseForStatus)(response, "add runs to annotation queue");
|
|
2670
|
+
}
|
|
2671
|
+
/**
|
|
2672
|
+
* Get a run from an annotation queue at the specified index.
|
|
2673
|
+
* @param queueId - The ID of the annotation queue
|
|
2674
|
+
* @param index - The index of the run to retrieve
|
|
2675
|
+
* @returns A Promise that resolves to a RunWithAnnotationQueueInfo object
|
|
2676
|
+
* @throws {Error} If the run is not found at the given index or for other API-related errors
|
|
2677
|
+
*/
|
|
2678
|
+
async getRunFromAnnotationQueue(queueId, index) {
|
|
2679
|
+
const baseUrl = `/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/run`;
|
|
2680
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}${baseUrl}/${index}`, {
|
|
2681
|
+
method: "GET",
|
|
2682
|
+
headers: this.headers,
|
|
2683
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2684
|
+
...this.fetchOptions,
|
|
2685
|
+
});
|
|
2686
|
+
await (0, error_js_1.raiseForStatus)(response, "get run from annotation queue");
|
|
2687
|
+
return await response.json();
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* Delete a run from an an annotation queue.
|
|
2691
|
+
* @param queueId - The ID of the annotation queue to delete the run from
|
|
2692
|
+
* @param queueRunId - The ID of the run to delete from the annotation queue
|
|
2693
|
+
*/
|
|
2694
|
+
async deleteRunFromAnnotationQueue(queueId, queueRunId) {
|
|
2695
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs/${(0, _uuid_js_1.assertUuid)(queueRunId, "queueRunId")}`, {
|
|
2696
|
+
method: "DELETE",
|
|
2697
|
+
headers: { ...this.headers, Accept: "application/json" },
|
|
2698
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2699
|
+
...this.fetchOptions,
|
|
2700
|
+
});
|
|
2701
|
+
await (0, error_js_1.raiseForStatus)(response, "delete run from annotation queue");
|
|
2702
|
+
}
|
|
2703
|
+
/**
|
|
2704
|
+
* Get the size of an annotation queue.
|
|
2705
|
+
* @param queueId - The ID of the annotation queue
|
|
2706
|
+
*/
|
|
2707
|
+
async getSizeFromAnnotationQueue(queueId) {
|
|
2708
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/size`, {
|
|
2709
|
+
method: "GET",
|
|
2710
|
+
headers: this.headers,
|
|
2711
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2712
|
+
...this.fetchOptions,
|
|
2713
|
+
});
|
|
2714
|
+
await (0, error_js_1.raiseForStatus)(response, "get size from annotation queue");
|
|
2715
|
+
return await response.json();
|
|
2716
|
+
}
|
|
2717
|
+
async _currentTenantIsOwner(owner) {
|
|
2718
|
+
const settings = await this._getSettings();
|
|
2719
|
+
return owner == "-" || settings.tenant_handle === owner;
|
|
2720
|
+
}
|
|
2721
|
+
async _ownerConflictError(action, owner) {
|
|
2722
|
+
const settings = await this._getSettings();
|
|
2723
|
+
return new Error(`Cannot ${action} for another tenant.\n
|
|
2724
|
+
Current tenant: ${settings.tenant_handle}\n
|
|
2725
|
+
Requested tenant: ${owner}`);
|
|
2726
|
+
}
|
|
2727
|
+
async _getLatestCommitHash(promptOwnerAndName) {
|
|
2728
|
+
const res = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${promptOwnerAndName}/?limit=${1}&offset=${0}`, {
|
|
2729
|
+
method: "GET",
|
|
2730
|
+
headers: this.headers,
|
|
2731
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2732
|
+
...this.fetchOptions,
|
|
2733
|
+
});
|
|
2734
|
+
const json = await res.json();
|
|
2735
|
+
if (!res.ok) {
|
|
2736
|
+
const detail = typeof json.detail === "string"
|
|
2737
|
+
? json.detail
|
|
2738
|
+
: JSON.stringify(json.detail);
|
|
2739
|
+
const error = new Error(`Error ${res.status}: ${res.statusText}\n${detail}`);
|
|
2740
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2741
|
+
error.statusCode = res.status;
|
|
2742
|
+
throw error;
|
|
2743
|
+
}
|
|
2744
|
+
if (json.commits.length === 0) {
|
|
2745
|
+
return undefined;
|
|
2746
|
+
}
|
|
2747
|
+
return json.commits[0].commit_hash;
|
|
2748
|
+
}
|
|
2749
|
+
async _likeOrUnlikePrompt(promptIdentifier, like) {
|
|
2750
|
+
const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
2751
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/likes/${owner}/${promptName}`, {
|
|
2752
|
+
method: "POST",
|
|
2753
|
+
body: JSON.stringify({ like: like }),
|
|
2754
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2755
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2756
|
+
...this.fetchOptions,
|
|
2757
|
+
});
|
|
2758
|
+
await (0, error_js_1.raiseForStatus)(response, `${like ? "like" : "unlike"} prompt`);
|
|
2759
|
+
return await response.json();
|
|
2760
|
+
}
|
|
2761
|
+
async _getPromptUrl(promptIdentifier) {
|
|
2762
|
+
const [owner, promptName, commitHash] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
2763
|
+
if (!(await this._currentTenantIsOwner(owner))) {
|
|
2764
|
+
if (commitHash !== "latest") {
|
|
2765
|
+
return `${this.getHostUrl()}/hub/${owner}/${promptName}/${commitHash.substring(0, 8)}`;
|
|
2766
|
+
}
|
|
2767
|
+
else {
|
|
2768
|
+
return `${this.getHostUrl()}/hub/${owner}/${promptName}`;
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
else {
|
|
2772
|
+
const settings = await this._getSettings();
|
|
2773
|
+
if (commitHash !== "latest") {
|
|
2774
|
+
return `${this.getHostUrl()}/prompts/${promptName}/${commitHash.substring(0, 8)}?organizationId=${settings.id}`;
|
|
2775
|
+
}
|
|
2776
|
+
else {
|
|
2777
|
+
return `${this.getHostUrl()}/prompts/${promptName}?organizationId=${settings.id}`;
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
async promptExists(promptIdentifier) {
|
|
2782
|
+
const prompt = await this.getPrompt(promptIdentifier);
|
|
2783
|
+
return !!prompt;
|
|
2784
|
+
}
|
|
2785
|
+
async likePrompt(promptIdentifier) {
|
|
2786
|
+
return this._likeOrUnlikePrompt(promptIdentifier, true);
|
|
2787
|
+
}
|
|
2788
|
+
async unlikePrompt(promptIdentifier) {
|
|
2789
|
+
return this._likeOrUnlikePrompt(promptIdentifier, false);
|
|
2790
|
+
}
|
|
2791
|
+
async *listCommits(promptOwnerAndName) {
|
|
2792
|
+
for await (const commits of this._getPaginated(`/commits/${promptOwnerAndName}/`, new URLSearchParams(), (res) => res.commits)) {
|
|
2793
|
+
yield* commits;
|
|
2794
|
+
}
|
|
2795
|
+
}
|
|
2796
|
+
async *listPrompts(options) {
|
|
2797
|
+
const params = new URLSearchParams();
|
|
2798
|
+
params.append("sort_field", options?.sortField ?? "updated_at");
|
|
2799
|
+
params.append("sort_direction", "desc");
|
|
2800
|
+
params.append("is_archived", (!!options?.isArchived).toString());
|
|
2801
|
+
if (options?.isPublic !== undefined) {
|
|
2802
|
+
params.append("is_public", options.isPublic.toString());
|
|
2803
|
+
}
|
|
2804
|
+
if (options?.query) {
|
|
2805
|
+
params.append("query", options.query);
|
|
2806
|
+
}
|
|
2807
|
+
for await (const prompts of this._getPaginated("/repos", params, (res) => res.repos)) {
|
|
2808
|
+
yield* prompts;
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
async getPrompt(promptIdentifier) {
|
|
2812
|
+
const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
2813
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
2814
|
+
method: "GET",
|
|
2815
|
+
headers: this.headers,
|
|
2816
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2817
|
+
...this.fetchOptions,
|
|
2818
|
+
});
|
|
2819
|
+
if (response.status === 404) {
|
|
2820
|
+
return null;
|
|
2821
|
+
}
|
|
2822
|
+
await (0, error_js_1.raiseForStatus)(response, "get prompt");
|
|
2823
|
+
const result = await response.json();
|
|
2824
|
+
if (result.repo) {
|
|
2825
|
+
return result.repo;
|
|
2826
|
+
}
|
|
2827
|
+
else {
|
|
2828
|
+
return null;
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
async createPrompt(promptIdentifier, options) {
|
|
2832
|
+
const settings = await this._getSettings();
|
|
2833
|
+
if (options?.isPublic && !settings.tenant_handle) {
|
|
2834
|
+
throw new Error(`Cannot create a public prompt without first\n
|
|
2835
|
+
creating a LangChain Hub handle.
|
|
2836
|
+
You can add a handle by creating a public prompt at:\n
|
|
2837
|
+
https://smith.langchain.com/prompts`);
|
|
2838
|
+
}
|
|
2839
|
+
const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
2840
|
+
if (!(await this._currentTenantIsOwner(owner))) {
|
|
2841
|
+
throw await this._ownerConflictError("create a prompt", owner);
|
|
2842
|
+
}
|
|
2843
|
+
const data = {
|
|
2844
|
+
repo_handle: promptName,
|
|
2845
|
+
...(options?.description && { description: options.description }),
|
|
2846
|
+
...(options?.readme && { readme: options.readme }),
|
|
2847
|
+
...(options?.tags && { tags: options.tags }),
|
|
2848
|
+
is_public: !!options?.isPublic,
|
|
2849
|
+
};
|
|
2850
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/`, {
|
|
2851
|
+
method: "POST",
|
|
2852
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2853
|
+
body: JSON.stringify(data),
|
|
2854
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2855
|
+
...this.fetchOptions,
|
|
2856
|
+
});
|
|
2857
|
+
await (0, error_js_1.raiseForStatus)(response, "create prompt");
|
|
2858
|
+
const { repo } = await response.json();
|
|
2859
|
+
return repo;
|
|
2860
|
+
}
|
|
2861
|
+
async createCommit(promptIdentifier, object, options) {
|
|
2862
|
+
if (!(await this.promptExists(promptIdentifier))) {
|
|
2863
|
+
throw new Error("Prompt does not exist, you must create it first.");
|
|
2864
|
+
}
|
|
2865
|
+
const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
2866
|
+
const resolvedParentCommitHash = options?.parentCommitHash === "latest" || !options?.parentCommitHash
|
|
2867
|
+
? await this._getLatestCommitHash(`${owner}/${promptName}`)
|
|
2868
|
+
: options?.parentCommitHash;
|
|
2869
|
+
const payload = {
|
|
2870
|
+
manifest: JSON.parse(JSON.stringify(object)),
|
|
2871
|
+
parent_commit: resolvedParentCommitHash,
|
|
2872
|
+
};
|
|
2873
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${owner}/${promptName}`, {
|
|
2874
|
+
method: "POST",
|
|
2875
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2876
|
+
body: JSON.stringify(payload),
|
|
2877
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2878
|
+
...this.fetchOptions,
|
|
2879
|
+
});
|
|
2880
|
+
await (0, error_js_1.raiseForStatus)(response, "create commit");
|
|
2881
|
+
const result = await response.json();
|
|
2882
|
+
return this._getPromptUrl(`${owner}/${promptName}${result.commit_hash ? `:${result.commit_hash}` : ""}`);
|
|
2883
|
+
}
|
|
2884
|
+
/**
|
|
2885
|
+
* Update examples with attachments using multipart form data.
|
|
2886
|
+
* @param updates List of ExampleUpdateWithAttachments objects to upsert
|
|
2887
|
+
* @returns Promise with the update response
|
|
2888
|
+
*/
|
|
2889
|
+
async updateExamplesMultipart(datasetId, updates = []) {
|
|
2890
|
+
return this._updateExamplesMultipart(datasetId, updates);
|
|
2891
|
+
}
|
|
2892
|
+
async _updateExamplesMultipart(datasetId, updates = []) {
|
|
2893
|
+
if (!(await this._getMultiPartSupport())) {
|
|
2894
|
+
throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
|
|
2895
|
+
}
|
|
2896
|
+
const formData = new FormData();
|
|
2897
|
+
for (const example of updates) {
|
|
2898
|
+
const exampleId = example.id;
|
|
2899
|
+
// Prepare the main example body
|
|
2900
|
+
const exampleBody = {
|
|
2901
|
+
...(example.metadata && { metadata: example.metadata }),
|
|
2902
|
+
...(example.split && { split: example.split }),
|
|
2903
|
+
};
|
|
2904
|
+
// Add main example data
|
|
2905
|
+
const stringifiedExample = (0, index_js_2.serialize)(exampleBody);
|
|
2906
|
+
const exampleBlob = new Blob([stringifiedExample], {
|
|
2907
|
+
type: "application/json",
|
|
2908
|
+
});
|
|
2909
|
+
formData.append(exampleId, exampleBlob);
|
|
2910
|
+
// Add inputs if present
|
|
2911
|
+
if (example.inputs) {
|
|
2912
|
+
const stringifiedInputs = (0, index_js_2.serialize)(example.inputs);
|
|
2913
|
+
const inputsBlob = new Blob([stringifiedInputs], {
|
|
2914
|
+
type: "application/json",
|
|
2915
|
+
});
|
|
2916
|
+
formData.append(`${exampleId}.inputs`, inputsBlob);
|
|
2917
|
+
}
|
|
2918
|
+
// Add outputs if present
|
|
2919
|
+
if (example.outputs) {
|
|
2920
|
+
const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs);
|
|
2921
|
+
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
2922
|
+
type: "application/json",
|
|
2923
|
+
});
|
|
2924
|
+
formData.append(`${exampleId}.outputs`, outputsBlob);
|
|
2925
|
+
}
|
|
2926
|
+
// Add attachments if present
|
|
2927
|
+
if (example.attachments) {
|
|
2928
|
+
for (const [name, attachment] of Object.entries(example.attachments)) {
|
|
2929
|
+
let mimeType;
|
|
2930
|
+
let data;
|
|
2931
|
+
if (Array.isArray(attachment)) {
|
|
2932
|
+
[mimeType, data] = attachment;
|
|
2933
|
+
}
|
|
2934
|
+
else {
|
|
2935
|
+
mimeType = attachment.mimeType;
|
|
2936
|
+
data = attachment.data;
|
|
2937
|
+
}
|
|
2938
|
+
const attachmentBlob = new Blob([data], {
|
|
2939
|
+
type: `${mimeType}; length=${data.byteLength}`,
|
|
2940
|
+
});
|
|
2941
|
+
formData.append(`${exampleId}.attachment.${name}`, attachmentBlob);
|
|
2942
|
+
}
|
|
2943
|
+
}
|
|
2944
|
+
if (example.attachments_operations) {
|
|
2945
|
+
const stringifiedAttachmentsOperations = (0, index_js_2.serialize)(example.attachments_operations);
|
|
2946
|
+
const attachmentsOperationsBlob = new Blob([stringifiedAttachmentsOperations], {
|
|
2947
|
+
type: "application/json",
|
|
2948
|
+
});
|
|
2949
|
+
formData.append(`${exampleId}.attachments_operations`, attachmentsOperationsBlob);
|
|
2950
|
+
}
|
|
2951
|
+
}
|
|
2952
|
+
const datasetIdToUse = datasetId ?? updates[0]?.dataset_id;
|
|
2953
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/v1/platform/datasets/${datasetIdToUse}/examples`, {
|
|
2954
|
+
method: "PATCH",
|
|
2955
|
+
headers: this.headers,
|
|
2956
|
+
body: formData,
|
|
2957
|
+
});
|
|
2958
|
+
const result = await response.json();
|
|
2959
|
+
return result;
|
|
2960
|
+
}
|
|
2961
|
+
/**
|
|
2962
|
+
* Upload examples with attachments using multipart form data.
|
|
2963
|
+
* @param uploads List of ExampleUploadWithAttachments objects to upload
|
|
2964
|
+
* @returns Promise with the upload response
|
|
2965
|
+
* @deprecated This method is deprecated and will be removed in future LangSmith versions, please use `createExamples` instead
|
|
2966
|
+
*/
|
|
2967
|
+
async uploadExamplesMultipart(datasetId, uploads = []) {
|
|
2968
|
+
return this._uploadExamplesMultipart(datasetId, uploads);
|
|
2969
|
+
}
|
|
2970
|
+
async _uploadExamplesMultipart(datasetId, uploads = []) {
|
|
2971
|
+
if (!(await this._getMultiPartSupport())) {
|
|
2972
|
+
throw new Error("Your LangSmith version does not allow using the multipart examples endpoint, please update to the latest version.");
|
|
2973
|
+
}
|
|
2974
|
+
const formData = new FormData();
|
|
2975
|
+
for (const example of uploads) {
|
|
2976
|
+
const exampleId = (example.id ?? uuid.v4()).toString();
|
|
2977
|
+
// Prepare the main example body
|
|
2978
|
+
const exampleBody = {
|
|
2979
|
+
created_at: example.created_at,
|
|
2980
|
+
...(example.metadata && { metadata: example.metadata }),
|
|
2981
|
+
...(example.split && { split: example.split }),
|
|
2982
|
+
...(example.source_run_id && { source_run_id: example.source_run_id }),
|
|
2983
|
+
...(example.use_source_run_io && {
|
|
2984
|
+
use_source_run_io: example.use_source_run_io,
|
|
2985
|
+
}),
|
|
2986
|
+
...(example.use_source_run_attachments && {
|
|
2987
|
+
use_source_run_attachments: example.use_source_run_attachments,
|
|
2988
|
+
}),
|
|
2989
|
+
};
|
|
2990
|
+
// Add main example data
|
|
2991
|
+
const stringifiedExample = (0, index_js_2.serialize)(exampleBody);
|
|
2992
|
+
const exampleBlob = new Blob([stringifiedExample], {
|
|
2993
|
+
type: "application/json",
|
|
2994
|
+
});
|
|
2995
|
+
formData.append(exampleId, exampleBlob);
|
|
2996
|
+
// Add inputs if present
|
|
2997
|
+
if (example.inputs) {
|
|
2998
|
+
const stringifiedInputs = (0, index_js_2.serialize)(example.inputs);
|
|
2999
|
+
const inputsBlob = new Blob([stringifiedInputs], {
|
|
3000
|
+
type: "application/json",
|
|
3001
|
+
});
|
|
3002
|
+
formData.append(`${exampleId}.inputs`, inputsBlob);
|
|
3003
|
+
}
|
|
3004
|
+
// Add outputs if present
|
|
3005
|
+
if (example.outputs) {
|
|
3006
|
+
const stringifiedOutputs = (0, index_js_2.serialize)(example.outputs);
|
|
3007
|
+
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
3008
|
+
type: "application/json",
|
|
3009
|
+
});
|
|
3010
|
+
formData.append(`${exampleId}.outputs`, outputsBlob);
|
|
3011
|
+
}
|
|
3012
|
+
// Add attachments if present
|
|
3013
|
+
if (example.attachments) {
|
|
3014
|
+
for (const [name, attachment] of Object.entries(example.attachments)) {
|
|
3015
|
+
let mimeType;
|
|
3016
|
+
let data;
|
|
3017
|
+
if (Array.isArray(attachment)) {
|
|
3018
|
+
[mimeType, data] = attachment;
|
|
3019
|
+
}
|
|
3020
|
+
else {
|
|
3021
|
+
mimeType = attachment.mimeType;
|
|
3022
|
+
data = attachment.data;
|
|
3023
|
+
}
|
|
3024
|
+
const attachmentBlob = new Blob([data], {
|
|
3025
|
+
type: `${mimeType}; length=${data.byteLength}`,
|
|
3026
|
+
});
|
|
3027
|
+
formData.append(`${exampleId}.attachment.${name}`, attachmentBlob);
|
|
3028
|
+
}
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/v1/platform/datasets/${datasetId}/examples`, {
|
|
3032
|
+
method: "POST",
|
|
3033
|
+
headers: this.headers,
|
|
3034
|
+
body: formData,
|
|
3035
|
+
});
|
|
3036
|
+
const result = await response.json();
|
|
3037
|
+
return result;
|
|
3038
|
+
}
|
|
3039
|
+
async updatePrompt(promptIdentifier, options) {
|
|
3040
|
+
if (!(await this.promptExists(promptIdentifier))) {
|
|
3041
|
+
throw new Error("Prompt does not exist, you must create it first.");
|
|
3042
|
+
}
|
|
3043
|
+
const [owner, promptName] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
3044
|
+
if (!(await this._currentTenantIsOwner(owner))) {
|
|
3045
|
+
throw await this._ownerConflictError("update a prompt", owner);
|
|
3046
|
+
}
|
|
3047
|
+
const payload = {};
|
|
3048
|
+
if (options?.description !== undefined)
|
|
3049
|
+
payload.description = options.description;
|
|
3050
|
+
if (options?.readme !== undefined)
|
|
3051
|
+
payload.readme = options.readme;
|
|
3052
|
+
if (options?.tags !== undefined)
|
|
3053
|
+
payload.tags = options.tags;
|
|
3054
|
+
if (options?.isPublic !== undefined)
|
|
3055
|
+
payload.is_public = options.isPublic;
|
|
3056
|
+
if (options?.isArchived !== undefined)
|
|
3057
|
+
payload.is_archived = options.isArchived;
|
|
3058
|
+
// Check if payload is empty
|
|
3059
|
+
if (Object.keys(payload).length === 0) {
|
|
3060
|
+
throw new Error("No valid update options provided");
|
|
3061
|
+
}
|
|
3062
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3063
|
+
method: "PATCH",
|
|
3064
|
+
body: JSON.stringify(payload),
|
|
3065
|
+
headers: {
|
|
3066
|
+
...this.headers,
|
|
3067
|
+
"Content-Type": "application/json",
|
|
3068
|
+
},
|
|
3069
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3070
|
+
...this.fetchOptions,
|
|
3071
|
+
});
|
|
3072
|
+
await (0, error_js_1.raiseForStatus)(response, "update prompt");
|
|
3073
|
+
return response.json();
|
|
3074
|
+
}
|
|
3075
|
+
async deletePrompt(promptIdentifier) {
|
|
3076
|
+
if (!(await this.promptExists(promptIdentifier))) {
|
|
3077
|
+
throw new Error("Prompt does not exist, you must create it first.");
|
|
3078
|
+
}
|
|
3079
|
+
const [owner, promptName, _] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
3080
|
+
if (!(await this._currentTenantIsOwner(owner))) {
|
|
3081
|
+
throw await this._ownerConflictError("delete a prompt", owner);
|
|
3082
|
+
}
|
|
3083
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/repos/${owner}/${promptName}`, {
|
|
3084
|
+
method: "DELETE",
|
|
3085
|
+
headers: this.headers,
|
|
3086
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3087
|
+
...this.fetchOptions,
|
|
3088
|
+
});
|
|
3089
|
+
return await response.json();
|
|
3090
|
+
}
|
|
3091
|
+
async pullPromptCommit(promptIdentifier, options) {
|
|
3092
|
+
const [owner, promptName, commitHash] = (0, prompts_js_1.parsePromptIdentifier)(promptIdentifier);
|
|
3093
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(), `${this.apiUrl}/commits/${owner}/${promptName}/${commitHash}${options?.includeModel ? "?include_model=true" : ""}`, {
|
|
3094
|
+
method: "GET",
|
|
3095
|
+
headers: this.headers,
|
|
3096
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
3097
|
+
...this.fetchOptions,
|
|
3098
|
+
});
|
|
3099
|
+
await (0, error_js_1.raiseForStatus)(response, "pull prompt commit");
|
|
3100
|
+
const result = await response.json();
|
|
3101
|
+
return {
|
|
3102
|
+
owner,
|
|
3103
|
+
repo: promptName,
|
|
3104
|
+
commit_hash: result.commit_hash,
|
|
3105
|
+
manifest: result.manifest,
|
|
3106
|
+
examples: result.examples,
|
|
3107
|
+
};
|
|
3108
|
+
}
|
|
3109
|
+
/**
|
|
3110
|
+
* This method should not be used directly, use `import { pull } from "langchain/hub"` instead.
|
|
3111
|
+
* Using this method directly returns the JSON string of the prompt rather than a LangChain object.
|
|
3112
|
+
* @private
|
|
3113
|
+
*/
|
|
3114
|
+
async _pullPrompt(promptIdentifier, options) {
|
|
3115
|
+
const promptObject = await this.pullPromptCommit(promptIdentifier, {
|
|
3116
|
+
includeModel: options?.includeModel,
|
|
3117
|
+
});
|
|
3118
|
+
const prompt = JSON.stringify(promptObject.manifest);
|
|
3119
|
+
return prompt;
|
|
3120
|
+
}
|
|
3121
|
+
async pushPrompt(promptIdentifier, options) {
|
|
3122
|
+
// Create or update prompt metadata
|
|
3123
|
+
if (await this.promptExists(promptIdentifier)) {
|
|
3124
|
+
if (options && Object.keys(options).some((key) => key !== "object")) {
|
|
3125
|
+
await this.updatePrompt(promptIdentifier, {
|
|
3126
|
+
description: options?.description,
|
|
3127
|
+
readme: options?.readme,
|
|
3128
|
+
tags: options?.tags,
|
|
3129
|
+
isPublic: options?.isPublic,
|
|
3130
|
+
});
|
|
3131
|
+
}
|
|
3132
|
+
}
|
|
3133
|
+
else {
|
|
3134
|
+
await this.createPrompt(promptIdentifier, {
|
|
3135
|
+
description: options?.description,
|
|
3136
|
+
readme: options?.readme,
|
|
3137
|
+
tags: options?.tags,
|
|
3138
|
+
isPublic: options?.isPublic,
|
|
3139
|
+
});
|
|
3140
|
+
}
|
|
3141
|
+
if (!options?.object) {
|
|
3142
|
+
return await this._getPromptUrl(promptIdentifier);
|
|
3143
|
+
}
|
|
3144
|
+
// Create a commit with the new manifest
|
|
3145
|
+
const url = await this.createCommit(promptIdentifier, options?.object, {
|
|
3146
|
+
parentCommitHash: options?.parentCommitHash,
|
|
3147
|
+
});
|
|
3148
|
+
return url;
|
|
3149
|
+
}
|
|
3150
|
+
/**
|
|
3151
|
+
* Clone a public dataset to your own langsmith tenant.
|
|
3152
|
+
* This operation is idempotent. If you already have a dataset with the given name,
|
|
3153
|
+
* this function will do nothing.
|
|
3154
|
+
|
|
3155
|
+
* @param {string} tokenOrUrl The token of the public dataset to clone.
|
|
3156
|
+
* @param {Object} [options] Additional options for cloning the dataset.
|
|
3157
|
+
* @param {string} [options.sourceApiUrl] The URL of the langsmith server where the data is hosted. Defaults to the API URL of your current client.
|
|
3158
|
+
* @param {string} [options.datasetName] The name of the dataset to create in your tenant. Defaults to the name of the public dataset.
|
|
3159
|
+
* @returns {Promise<void>}
|
|
3160
|
+
*/
|
|
3161
|
+
async clonePublicDataset(tokenOrUrl, options = {}) {
|
|
3162
|
+
const { sourceApiUrl = this.apiUrl, datasetName } = options;
|
|
3163
|
+
const [parsedApiUrl, tokenUuid] = this.parseTokenOrUrl(tokenOrUrl, sourceApiUrl);
|
|
3164
|
+
const sourceClient = new Client({
|
|
3165
|
+
apiUrl: parsedApiUrl,
|
|
3166
|
+
// Placeholder API key not needed anymore in most cases, but
|
|
3167
|
+
// some private deployments may have API key-based rate limiting
|
|
3168
|
+
// that would cause this to fail if we provide no value.
|
|
3169
|
+
apiKey: "placeholder",
|
|
3170
|
+
});
|
|
3171
|
+
const ds = await sourceClient.readSharedDataset(tokenUuid);
|
|
3172
|
+
const finalDatasetName = datasetName || ds.name;
|
|
3173
|
+
try {
|
|
3174
|
+
if (await this.hasDataset({ datasetId: finalDatasetName })) {
|
|
3175
|
+
console.log(`Dataset ${finalDatasetName} already exists in your tenant. Skipping.`);
|
|
3176
|
+
return;
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
catch (_) {
|
|
3180
|
+
// `.hasDataset` will throw an error if the dataset does not exist.
|
|
3181
|
+
// no-op in that case
|
|
3182
|
+
}
|
|
3183
|
+
// Fetch examples first, then create the dataset
|
|
3184
|
+
const examples = await sourceClient.listSharedExamples(tokenUuid);
|
|
3185
|
+
const dataset = await this.createDataset(finalDatasetName, {
|
|
3186
|
+
description: ds.description,
|
|
3187
|
+
dataType: ds.data_type || "kv",
|
|
3188
|
+
inputsSchema: ds.inputs_schema_definition ?? undefined,
|
|
3189
|
+
outputsSchema: ds.outputs_schema_definition ?? undefined,
|
|
3190
|
+
});
|
|
3191
|
+
try {
|
|
3192
|
+
await this.createExamples({
|
|
3193
|
+
inputs: examples.map((e) => e.inputs),
|
|
3194
|
+
outputs: examples.flatMap((e) => (e.outputs ? [e.outputs] : [])),
|
|
3195
|
+
datasetId: dataset.id,
|
|
3196
|
+
});
|
|
3197
|
+
}
|
|
3198
|
+
catch (e) {
|
|
3199
|
+
console.error(`An error occurred while creating dataset ${finalDatasetName}. ` +
|
|
3200
|
+
"You should delete it manually.");
|
|
3201
|
+
throw e;
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
parseTokenOrUrl(urlOrToken, apiUrl, numParts = 2, kind = "dataset") {
|
|
3205
|
+
// Try parsing as UUID
|
|
3206
|
+
try {
|
|
3207
|
+
(0, _uuid_js_1.assertUuid)(urlOrToken); // Will throw if it's not a UUID.
|
|
3208
|
+
return [apiUrl, urlOrToken];
|
|
3209
|
+
}
|
|
3210
|
+
catch (_) {
|
|
3211
|
+
// no-op if it's not a uuid
|
|
3212
|
+
}
|
|
3213
|
+
// Parse as URL
|
|
3214
|
+
try {
|
|
3215
|
+
const parsedUrl = new URL(urlOrToken);
|
|
3216
|
+
const pathParts = parsedUrl.pathname
|
|
3217
|
+
.split("/")
|
|
3218
|
+
.filter((part) => part !== "");
|
|
3219
|
+
if (pathParts.length >= numParts) {
|
|
3220
|
+
const tokenUuid = pathParts[pathParts.length - numParts];
|
|
3221
|
+
return [apiUrl, tokenUuid];
|
|
3222
|
+
}
|
|
3223
|
+
else {
|
|
3224
|
+
throw new Error(`Invalid public ${kind} URL: ${urlOrToken}`);
|
|
3225
|
+
}
|
|
3226
|
+
}
|
|
3227
|
+
catch (error) {
|
|
3228
|
+
throw new Error(`Invalid public ${kind} URL or token: ${urlOrToken}`);
|
|
3229
|
+
}
|
|
3230
|
+
}
|
|
3231
|
+
/**
|
|
3232
|
+
* Awaits all pending trace batches. Useful for environments where
|
|
3233
|
+
* you need to be sure that all tracing requests finish before execution ends,
|
|
3234
|
+
* such as serverless environments.
|
|
3235
|
+
*
|
|
3236
|
+
* @example
|
|
3237
|
+
* ```
|
|
3238
|
+
* import { Client } from "langsmith";
|
|
3239
|
+
*
|
|
3240
|
+
* const client = new Client();
|
|
3241
|
+
*
|
|
3242
|
+
* try {
|
|
3243
|
+
* // Tracing happens here
|
|
3244
|
+
* ...
|
|
3245
|
+
* } finally {
|
|
3246
|
+
* await client.awaitPendingTraceBatches();
|
|
3247
|
+
* }
|
|
3248
|
+
* ```
|
|
3249
|
+
*
|
|
3250
|
+
* @returns A promise that resolves once all currently pending traces have sent.
|
|
3251
|
+
*/
|
|
3252
|
+
awaitPendingTraceBatches() {
|
|
3253
|
+
if (this.manualFlushMode) {
|
|
3254
|
+
console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches.");
|
|
3255
|
+
return Promise.resolve();
|
|
3256
|
+
}
|
|
3257
|
+
return Promise.all([
|
|
3258
|
+
...this.autoBatchQueue.items.map(({ itemPromise }) => itemPromise),
|
|
3259
|
+
this.batchIngestCaller.queue.onIdle(),
|
|
3260
|
+
]);
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
exports.Client = Client;
|
|
3264
|
+
function isExampleCreate(input) {
|
|
3265
|
+
return "dataset_id" in input || "dataset_name" in input;
|
|
3266
|
+
}
|