@mastra/core 1.0.0-beta.13 → 1.0.0-beta.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +477 -0
- package/dist/agent/agent-legacy.d.ts.map +1 -1
- package/dist/agent/agent.d.ts +2 -2
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.types.d.ts +6 -7
- package/dist/agent/agent.types.d.ts.map +1 -1
- package/dist/agent/index.cjs +17 -9
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +2 -2
- package/dist/agent/message-list/index.cjs +3 -3
- package/dist/agent/message-list/index.d.ts +1 -1
- package/dist/agent/message-list/index.d.ts.map +1 -1
- package/dist/agent/message-list/index.js +1 -1
- package/dist/agent/message-list/prompt/attachments-to-parts.d.ts.map +1 -1
- package/dist/agent/trip-wire.d.ts +2 -2
- package/dist/agent/trip-wire.d.ts.map +1 -1
- package/dist/agent/utils.d.ts +4 -1
- package/dist/agent/utils.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/index.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/index.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/map-results-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/prepare-memory-step.d.ts.map +1 -1
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts +3 -3
- package/dist/agent/workflows/prepare-stream/prepare-tools-step.d.ts.map +1 -1
- package/dist/bundler/types.d.ts +1 -0
- package/dist/bundler/types.d.ts.map +1 -1
- package/dist/chunk-2AU5ZHBL.js +79 -0
- package/dist/chunk-2AU5ZHBL.js.map +1 -0
- package/dist/{chunk-7HEAVZRS.cjs → chunk-2OOMJRXZ.cjs} +15 -15
- package/dist/{chunk-7HEAVZRS.cjs.map → chunk-2OOMJRXZ.cjs.map} +1 -1
- package/dist/chunk-37YWZMBX.js +27 -0
- package/dist/chunk-37YWZMBX.js.map +1 -0
- package/dist/{chunk-VETAQUW3.js → chunk-3HDRO3GG.js} +790 -1206
- package/dist/chunk-3HDRO3GG.js.map +1 -0
- package/dist/{chunk-MRRFTNF4.js → chunk-4DFWV4IR.js} +3 -4
- package/dist/chunk-4DFWV4IR.js.map +1 -0
- package/dist/{chunk-373OC54J.js → chunk-4HP7CS6L.js} +7 -6
- package/dist/chunk-4HP7CS6L.js.map +1 -0
- package/dist/{chunk-62Q7K656.js → chunk-4J4M2Q5R.js} +125 -121
- package/dist/chunk-4J4M2Q5R.js.map +1 -0
- package/dist/{chunk-HWMMIRIF.cjs → chunk-4U7ZLI36.cjs} +3 -2
- package/dist/chunk-4U7ZLI36.cjs.map +1 -0
- package/dist/{chunk-Z55SJVEC.cjs → chunk-6HJFCSJ4.cjs} +7 -6
- package/dist/chunk-6HJFCSJ4.cjs.map +1 -0
- package/dist/{chunk-Y7MZ5LJT.cjs → chunk-AAX7ZOM7.cjs} +101 -102
- package/dist/chunk-AAX7ZOM7.cjs.map +1 -0
- package/dist/{chunk-WPTTKULS.js → chunk-AR5CF3IN.js} +4 -4
- package/dist/{chunk-WPTTKULS.js.map → chunk-AR5CF3IN.js.map} +1 -1
- package/dist/{chunk-5VZGJTPR.js → chunk-BAZHNX5P.js} +57 -11
- package/dist/chunk-BAZHNX5P.js.map +1 -0
- package/dist/{chunk-MLKE7HRS.cjs → chunk-BC2VKOH4.cjs} +43 -21
- package/dist/chunk-BC2VKOH4.cjs.map +1 -0
- package/dist/{chunk-2IU4RGU5.js → chunk-BCUKD2XG.js} +59 -19
- package/dist/chunk-BCUKD2XG.js.map +1 -0
- package/dist/{chunk-WYGUWVTF.js → chunk-CBQ6WDUJ.js} +9 -9
- package/dist/chunk-CBQ6WDUJ.js.map +1 -0
- package/dist/chunk-CBVHOGXX.cjs +674 -0
- package/dist/chunk-CBVHOGXX.cjs.map +1 -0
- package/dist/{chunk-PJAK4U6R.cjs → chunk-CBY37FTP.cjs} +28 -28
- package/dist/chunk-CBY37FTP.cjs.map +1 -0
- package/dist/{chunk-BQDZIQ3G.js → chunk-D2IFWD7A.js} +365 -137
- package/dist/chunk-D2IFWD7A.js.map +1 -0
- package/dist/{chunk-R5AJGM55.cjs → chunk-DDK3URK2.cjs} +987 -519
- package/dist/chunk-DDK3URK2.cjs.map +1 -0
- package/dist/chunk-DRJTNGI4.cjs +263 -0
- package/dist/chunk-DRJTNGI4.cjs.map +1 -0
- package/dist/{chunk-X6IBA7FP.cjs → chunk-EMLEZXTQ.cjs} +22 -120
- package/dist/chunk-EMLEZXTQ.cjs.map +1 -0
- package/dist/{chunk-OWIEOL55.cjs → chunk-F75EQ574.cjs} +695 -254
- package/dist/chunk-F75EQ574.cjs.map +1 -0
- package/dist/{chunk-YPLZDWG7.js → chunk-FJEVLHJT.js} +3 -2
- package/dist/chunk-FJEVLHJT.js.map +1 -0
- package/dist/chunk-GVAPYQRO.cjs +252 -0
- package/dist/chunk-GVAPYQRO.cjs.map +1 -0
- package/dist/{chunk-MXBVP7HX.cjs → chunk-GXMJ5URG.cjs} +227 -181
- package/dist/chunk-GXMJ5URG.cjs.map +1 -0
- package/dist/chunk-H2NHG7QL.cjs +32 -0
- package/dist/chunk-H2NHG7QL.cjs.map +1 -0
- package/dist/chunk-HAYBGFPA.js +259 -0
- package/dist/chunk-HAYBGFPA.js.map +1 -0
- package/dist/{chunk-GIWC35YQ.js → chunk-IHISDRFV.js} +299 -49
- package/dist/chunk-IHISDRFV.js.map +1 -0
- package/dist/{chunk-VEPP75C4.cjs → chunk-IRTICXRZ.cjs} +101 -61
- package/dist/chunk-IRTICXRZ.cjs.map +1 -0
- package/dist/{chunk-ARAQIW6E.js → chunk-K66U47VL.js} +617 -188
- package/dist/chunk-K66U47VL.js.map +1 -0
- package/dist/{chunk-LGB4VNZI.cjs → chunk-LOV5NNGK.cjs} +811 -1235
- package/dist/chunk-LOV5NNGK.cjs.map +1 -0
- package/dist/{chunk-E5BQRAJK.js → chunk-NGWTSHNA.js} +823 -362
- package/dist/chunk-NGWTSHNA.js.map +1 -0
- package/dist/{chunk-72YCRTEX.cjs → chunk-O2CAMK4A.cjs} +13 -2
- package/dist/chunk-O2CAMK4A.cjs.map +1 -0
- package/dist/{chunk-4BC5FUAO.js → chunk-O7M7DR4E.js} +6 -5
- package/dist/chunk-O7M7DR4E.js.map +1 -0
- package/dist/chunk-OTIGV7CL.js +10215 -0
- package/dist/chunk-OTIGV7CL.js.map +1 -0
- package/dist/{chunk-WYWRMIQC.js → chunk-QXL3F3T2.js} +9 -105
- package/dist/chunk-QXL3F3T2.js.map +1 -0
- package/dist/{chunk-U4CSOY6T.cjs → chunk-RA2CHJCY.cjs} +399 -171
- package/dist/chunk-RA2CHJCY.cjs.map +1 -0
- package/dist/chunk-RMV5HJM7.cjs +10237 -0
- package/dist/chunk-RMV5HJM7.cjs.map +1 -0
- package/dist/{chunk-AGHLXC4I.cjs → chunk-S23TNDXG.cjs} +300 -50
- package/dist/chunk-S23TNDXG.cjs.map +1 -0
- package/dist/{chunk-H4VUIOWU.cjs → chunk-SSB4AVHU.cjs} +20 -19
- package/dist/chunk-SSB4AVHU.cjs.map +1 -0
- package/dist/chunk-ST7NBF4H.cjs +84 -0
- package/dist/chunk-ST7NBF4H.cjs.map +1 -0
- package/dist/{chunk-SZYSDJTN.cjs → chunk-T2LVULCK.cjs} +142 -137
- package/dist/chunk-T2LVULCK.cjs.map +1 -0
- package/dist/chunk-VE6HQ7H6.js +250 -0
- package/dist/chunk-VE6HQ7H6.js.map +1 -0
- package/dist/{chunk-RCJLMMTO.js → chunk-XJB7J4UT.js} +30 -8
- package/dist/chunk-XJB7J4UT.js.map +1 -0
- package/dist/chunk-YV43YEZ6.js +598 -0
- package/dist/chunk-YV43YEZ6.js.map +1 -0
- package/dist/{chunk-Y36Y5MTD.js → chunk-ZGIVAQRI.js} +13 -3
- package/dist/chunk-ZGIVAQRI.js.map +1 -0
- package/dist/error/index.cjs +6 -6
- package/dist/error/index.d.ts +1 -0
- package/dist/error/index.d.ts.map +1 -1
- package/dist/error/index.js +1 -1
- package/dist/evals/index.cjs +49 -9
- package/dist/evals/index.js +2 -2
- package/dist/evals/run/index.d.ts.map +1 -1
- package/dist/evals/scoreTraces/index.cjs +70 -22
- package/dist/evals/scoreTraces/index.cjs.map +1 -1
- package/dist/evals/scoreTraces/index.js +63 -15
- package/dist/evals/scoreTraces/index.js.map +1 -1
- package/dist/evals/scoreTraces/scoreTracesWorkflow.d.ts.map +1 -1
- package/dist/evals/scoreTraces/utils.d.ts.map +1 -1
- package/dist/evals/types.d.ts +568 -116
- package/dist/evals/types.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/integration/index.cjs +2 -2
- package/dist/integration/index.js +1 -1
- package/dist/llm/index.cjs +21 -21
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/aisdk/generate-to-stream.d.ts +20 -0
- package/dist/llm/model/aisdk/generate-to-stream.d.ts.map +1 -0
- package/dist/llm/model/aisdk/v5/model.d.ts +4 -0
- package/dist/llm/model/aisdk/v5/model.d.ts.map +1 -1
- package/dist/llm/model/aisdk/v6/model.d.ts +43 -0
- package/dist/llm/model/aisdk/v6/model.d.ts.map +1 -0
- package/dist/llm/model/embedding-router.d.ts +1 -1
- package/dist/llm/model/model.d.ts.map +1 -1
- package/dist/llm/model/model.loop.d.ts +1 -1
- package/dist/llm/model/model.loop.d.ts.map +1 -1
- package/dist/llm/model/provider-options.d.ts +2 -1
- package/dist/llm/model/provider-options.d.ts.map +1 -1
- package/dist/llm/model/provider-types.generated.d.ts +126 -17
- package/dist/llm/model/resolve-model.d.ts +2 -2
- package/dist/llm/model/resolve-model.d.ts.map +1 -1
- package/dist/llm/model/shared.types.d.ts +18 -7
- package/dist/llm/model/shared.types.d.ts.map +1 -1
- package/dist/loop/index.cjs +2 -2
- package/dist/loop/index.js +1 -1
- package/dist/loop/network/index.d.ts +8 -8
- package/dist/loop/network/index.d.ts.map +1 -1
- package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts +1 -1
- package/dist/loop/test-utils/MastraLanguageModelV2Mock.d.ts.map +1 -1
- package/dist/loop/test-utils/MastraLanguageModelV3Mock.d.ts +29 -0
- package/dist/loop/test-utils/MastraLanguageModelV3Mock.d.ts.map +1 -0
- package/dist/loop/test-utils/fullStream.d.ts +2 -1
- package/dist/loop/test-utils/fullStream.d.ts.map +1 -1
- package/dist/loop/test-utils/resultObject.d.ts +2 -1
- package/dist/loop/test-utils/resultObject.d.ts.map +1 -1
- package/dist/loop/test-utils/streamObject.d.ts.map +1 -1
- package/dist/loop/test-utils/utils-v3.d.ts +55 -0
- package/dist/loop/test-utils/utils-v3.d.ts.map +1 -0
- package/dist/loop/types.d.ts +10 -8
- package/dist/loop/types.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/index.d.ts +36 -36
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts +25 -25
- package/dist/loop/workflows/agentic-execution/llm-execution-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-execution/llm-mapping-step.d.ts +12 -12
- package/dist/loop/workflows/agentic-execution/tool-call-step.d.ts.map +1 -1
- package/dist/loop/workflows/agentic-loop/index.d.ts +36 -36
- package/dist/loop/workflows/agentic-loop/index.d.ts.map +1 -1
- package/dist/loop/workflows/run-state.d.ts +2 -2
- package/dist/loop/workflows/run-state.d.ts.map +1 -1
- package/dist/loop/workflows/schema.d.ts +12 -12
- package/dist/mastra/hooks.d.ts.map +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.d.ts +7 -2
- package/dist/mastra/index.d.ts.map +1 -1
- package/dist/mastra/index.js +1 -1
- package/dist/mcp/index.cjs +4 -4
- package/dist/mcp/index.js +1 -1
- package/dist/memory/index.cjs +26 -6
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/memory/memory.d.ts +9 -8
- package/dist/memory/memory.d.ts.map +1 -1
- package/dist/memory/mock.d.ts +2 -1
- package/dist/memory/mock.d.ts.map +1 -1
- package/dist/memory/types.d.ts +3 -4
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/memory/working-memory-utils.d.ts +20 -0
- package/dist/memory/working-memory-utils.d.ts.map +1 -0
- package/dist/models-dev-26XLUKVK.cjs +12 -0
- package/dist/{models-dev-D3EKFGAO.cjs.map → models-dev-26XLUKVK.cjs.map} +1 -1
- package/dist/models-dev-HUFLQFPB.js +3 -0
- package/dist/{models-dev-EO22XOXQ.js.map → models-dev-HUFLQFPB.js.map} +1 -1
- package/dist/netlify-CUYK2MZ2.cjs +12 -0
- package/dist/{netlify-WE42TZIT.cjs.map → netlify-CUYK2MZ2.cjs.map} +1 -1
- package/dist/netlify-J4QPOROO.js +3 -0
- package/dist/{netlify-AE4LNCAI.js.map → netlify-J4QPOROO.js.map} +1 -1
- package/dist/observability/index.cjs +14 -10
- package/dist/observability/index.js +1 -1
- package/dist/observability/types/tracing.d.ts +32 -19
- package/dist/observability/types/tracing.d.ts.map +1 -1
- package/dist/processors/index.cjs +37 -37
- package/dist/processors/index.d.ts +9 -7
- package/dist/processors/index.d.ts.map +1 -1
- package/dist/processors/index.js +1 -1
- package/dist/processors/memory/message-history.d.ts +7 -1
- package/dist/processors/memory/message-history.d.ts.map +1 -1
- package/dist/processors/processors/language-detector.d.ts.map +1 -1
- package/dist/processors/processors/moderation.d.ts.map +1 -1
- package/dist/processors/processors/pii-detector.d.ts.map +1 -1
- package/dist/processors/processors/prompt-injection-detector.d.ts.map +1 -1
- package/dist/processors/processors/token-limiter.d.ts +5 -2
- package/dist/processors/processors/token-limiter.d.ts.map +1 -1
- package/dist/processors/runner.d.ts +2 -0
- package/dist/processors/runner.d.ts.map +1 -1
- package/dist/processors/step-schema.d.ts +26 -26
- package/dist/processors/step-schema.d.ts.map +1 -1
- package/dist/provider-registry-6CIGRQVZ.js +3 -0
- package/dist/{provider-registry-6LF3NGC5.js.map → provider-registry-6CIGRQVZ.js.map} +1 -1
- package/dist/provider-registry-7O7FJ4BS.cjs +40 -0
- package/dist/{provider-registry-73FKMXJV.cjs.map → provider-registry-7O7FJ4BS.cjs.map} +1 -1
- package/dist/provider-registry.json +295 -45
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.cjs.map +1 -1
- package/dist/relevance/index.js +2 -2
- package/dist/relevance/index.js.map +1 -1
- package/dist/server/index.cjs +5 -5
- package/dist/server/index.js +1 -1
- package/dist/storage/base.d.ts +40 -292
- package/dist/storage/base.d.ts.map +1 -1
- package/dist/storage/constants.cjs +60 -0
- package/dist/storage/constants.cjs.map +1 -0
- package/dist/storage/constants.d.ts +6 -1
- package/dist/storage/constants.d.ts.map +1 -1
- package/dist/storage/constants.js +3 -0
- package/dist/storage/constants.js.map +1 -0
- package/dist/storage/domains/agents/base.d.ts +2 -2
- package/dist/storage/domains/agents/base.d.ts.map +1 -1
- package/dist/storage/domains/agents/inmemory.d.ts +5 -4
- package/dist/storage/domains/agents/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/base.d.ts +20 -0
- package/dist/storage/domains/base.d.ts.map +1 -0
- package/dist/storage/domains/index.d.ts +3 -0
- package/dist/storage/domains/index.d.ts.map +1 -1
- package/dist/storage/domains/inmemory-db.d.ts +57 -0
- package/dist/storage/domains/inmemory-db.d.ts.map +1 -0
- package/dist/storage/domains/memory/base.d.ts +2 -2
- package/dist/storage/domains/memory/base.d.ts.map +1 -1
- package/dist/storage/domains/memory/inmemory.d.ts +5 -13
- package/dist/storage/domains/memory/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/base.d.ts +24 -29
- package/dist/storage/domains/observability/base.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +1 -0
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/inmemory.d.ts +46 -35
- package/dist/storage/domains/observability/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/observability/types.d.ts +2365 -0
- package/dist/storage/domains/observability/types.d.ts.map +1 -0
- package/dist/storage/domains/scores/base.d.ts +9 -20
- package/dist/storage/domains/scores/base.d.ts.map +1 -1
- package/dist/storage/domains/scores/inmemory.d.ts +11 -22
- package/dist/storage/domains/scores/inmemory.d.ts.map +1 -1
- package/dist/storage/domains/shared.d.ts +76 -0
- package/dist/storage/domains/shared.d.ts.map +1 -0
- package/dist/storage/domains/workflows/base.d.ts +4 -2
- package/dist/storage/domains/workflows/base.d.ts.map +1 -1
- package/dist/storage/domains/workflows/inmemory.d.ts +10 -9
- package/dist/storage/domains/workflows/inmemory.d.ts.map +1 -1
- package/dist/storage/index.cjs +272 -59
- package/dist/storage/index.js +2 -1
- package/dist/storage/mock.d.ts +28 -174
- package/dist/storage/mock.d.ts.map +1 -1
- package/dist/storage/types.d.ts +39 -44
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/utils.d.ts +5 -0
- package/dist/storage/utils.d.ts.map +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts +1 -1
- package/dist/stream/MastraAgentNetworkStream.d.ts.map +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts +1 -1
- package/dist/stream/MastraWorkflowStream.d.ts.map +1 -1
- package/dist/stream/RunOutput.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/execute.d.ts +4 -4
- package/dist/stream/aisdk/v5/execute.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/output.d.ts +2 -2
- package/dist/stream/aisdk/v5/output.d.ts.map +1 -1
- package/dist/stream/aisdk/v5/transform.d.ts.map +1 -1
- package/dist/stream/base/output.d.ts +7 -5
- package/dist/stream/base/output.d.ts.map +1 -1
- package/dist/stream/index.cjs +12 -12
- package/dist/stream/index.js +2 -2
- package/dist/stream/types.d.ts +32 -21
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/test-utils/llm-mock.cjs +4 -4
- package/dist/test-utils/llm-mock.cjs.map +1 -1
- package/dist/test-utils/llm-mock.js +1 -1
- package/dist/test-utils/llm-mock.js.map +1 -1
- package/dist/token-6GSAFR2W-LTZ7QQUP.js +61 -0
- package/dist/token-6GSAFR2W-LTZ7QQUP.js.map +1 -0
- package/dist/token-6GSAFR2W-UEEINYAN.cjs +63 -0
- package/dist/token-6GSAFR2W-UEEINYAN.cjs.map +1 -0
- package/dist/token-util-NEHG7TUY-QTFZ26EN.js +8 -0
- package/dist/token-util-NEHG7TUY-QTFZ26EN.js.map +1 -0
- package/dist/token-util-NEHG7TUY-WZL2DNCG.cjs +10 -0
- package/dist/token-util-NEHG7TUY-WZL2DNCG.cjs.map +1 -0
- package/dist/tool-loop-agent/index.cjs +20 -0
- package/dist/tool-loop-agent/index.cjs.map +1 -0
- package/dist/tool-loop-agent/index.d.ts +36 -0
- package/dist/tool-loop-agent/index.d.ts.map +1 -0
- package/dist/tool-loop-agent/index.js +3 -0
- package/dist/tool-loop-agent/index.js.map +1 -0
- package/dist/tool-loop-agent/tool-loop-processor.d.ts +30 -0
- package/dist/tool-loop-agent/tool-loop-processor.d.ts.map +1 -0
- package/dist/tool-loop-agent/utils.d.ts +17 -0
- package/dist/tool-loop-agent/utils.d.ts.map +1 -0
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.js +1 -1
- package/dist/tools/is-vercel-tool.cjs +2 -2
- package/dist/tools/is-vercel-tool.js +1 -1
- package/dist/tools/tool-builder/builder.d.ts.map +1 -1
- package/dist/tools/toolchecks.d.ts +1 -1
- package/dist/tools/toolchecks.d.ts.map +1 -1
- package/dist/tools/validation.d.ts +1 -1
- package/dist/tools/validation.d.ts.map +1 -1
- package/dist/utils/zod-utils.d.ts +34 -0
- package/dist/utils/zod-utils.d.ts.map +1 -0
- package/dist/utils.cjs +39 -22
- package/dist/utils.d.ts +3 -3
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -1
- package/dist/vector/embed.d.ts +1 -0
- package/dist/vector/embed.d.ts.map +1 -1
- package/dist/vector/index.cjs +18 -5
- package/dist/vector/index.cjs.map +1 -1
- package/dist/vector/index.js +9 -2
- package/dist/vector/index.js.map +1 -1
- package/dist/vector/vector.d.ts +26 -3
- package/dist/vector/vector.d.ts.map +1 -1
- package/dist/voice/composite-voice.d.ts.map +1 -1
- package/dist/voice/index.cjs +6 -6
- package/dist/voice/index.js +1 -1
- package/dist/workflows/default.d.ts +2 -0
- package/dist/workflows/default.d.ts.map +1 -1
- package/dist/workflows/evented/execution-engine.d.ts +1 -0
- package/dist/workflows/evented/execution-engine.d.ts.map +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/evented/step-executor.d.ts +5 -0
- package/dist/workflows/evented/step-executor.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/index.d.ts +20 -4
- package/dist/workflows/evented/workflow-event-processor/index.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/loop.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/parallel.d.ts.map +1 -1
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts +2 -2
- package/dist/workflows/evented/workflow-event-processor/sleep.d.ts.map +1 -1
- package/dist/workflows/evented/workflow.d.ts +10 -2
- package/dist/workflows/evented/workflow.d.ts.map +1 -1
- package/dist/workflows/execution-engine.d.ts +1 -0
- package/dist/workflows/execution-engine.d.ts.map +1 -1
- package/dist/workflows/handlers/control-flow.d.ts +4 -0
- package/dist/workflows/handlers/control-flow.d.ts.map +1 -1
- package/dist/workflows/handlers/entry.d.ts +3 -2
- package/dist/workflows/handlers/entry.d.ts.map +1 -1
- package/dist/workflows/handlers/step.d.ts +1 -0
- package/dist/workflows/handlers/step.d.ts.map +1 -1
- package/dist/workflows/index.cjs +23 -23
- package/dist/workflows/index.js +1 -1
- package/dist/workflows/types.d.ts +23 -3
- package/dist/workflows/types.d.ts.map +1 -1
- package/dist/workflows/utils.d.ts +1 -0
- package/dist/workflows/utils.d.ts.map +1 -1
- package/dist/workflows/workflow.d.ts +26 -9
- package/dist/workflows/workflow.d.ts.map +1 -1
- package/package.json +20 -12
- package/src/llm/model/provider-types.generated.d.ts +126 -17
- package/storage/constants.d.ts +1 -0
- package/tool-loop-agent.d.ts +1 -0
- package/dist/chunk-2IU4RGU5.js.map +0 -1
- package/dist/chunk-373OC54J.js.map +0 -1
- package/dist/chunk-4BC5FUAO.js.map +0 -1
- package/dist/chunk-5VZGJTPR.js.map +0 -1
- package/dist/chunk-62Q7K656.js.map +0 -1
- package/dist/chunk-72YCRTEX.cjs.map +0 -1
- package/dist/chunk-ADADLFDR.js +0 -42
- package/dist/chunk-ADADLFDR.js.map +0 -1
- package/dist/chunk-AGHLXC4I.cjs.map +0 -1
- package/dist/chunk-ARAQIW6E.js.map +0 -1
- package/dist/chunk-BQDZIQ3G.js.map +0 -1
- package/dist/chunk-E5BQRAJK.js.map +0 -1
- package/dist/chunk-GIWC35YQ.js.map +0 -1
- package/dist/chunk-H4VUIOWU.cjs.map +0 -1
- package/dist/chunk-HWMMIRIF.cjs.map +0 -1
- package/dist/chunk-IXZ2T2QX.cjs +0 -448
- package/dist/chunk-IXZ2T2QX.cjs.map +0 -1
- package/dist/chunk-LGB4VNZI.cjs.map +0 -1
- package/dist/chunk-MLKE7HRS.cjs.map +0 -1
- package/dist/chunk-MRRFTNF4.js.map +0 -1
- package/dist/chunk-MXBVP7HX.cjs.map +0 -1
- package/dist/chunk-OWIEOL55.cjs.map +0 -1
- package/dist/chunk-PJAK4U6R.cjs.map +0 -1
- package/dist/chunk-R5AJGM55.cjs.map +0 -1
- package/dist/chunk-RCJLMMTO.js.map +0 -1
- package/dist/chunk-SZYSDJTN.cjs.map +0 -1
- package/dist/chunk-T2VLUFGG.cjs +0 -47
- package/dist/chunk-T2VLUFGG.cjs.map +0 -1
- package/dist/chunk-U4CSOY6T.cjs.map +0 -1
- package/dist/chunk-UBSPZTQX.js +0 -434
- package/dist/chunk-UBSPZTQX.js.map +0 -1
- package/dist/chunk-VEPP75C4.cjs.map +0 -1
- package/dist/chunk-VETAQUW3.js.map +0 -1
- package/dist/chunk-WYGUWVTF.js.map +0 -1
- package/dist/chunk-WYWRMIQC.js.map +0 -1
- package/dist/chunk-X6IBA7FP.cjs.map +0 -1
- package/dist/chunk-Y36Y5MTD.js.map +0 -1
- package/dist/chunk-Y7MZ5LJT.cjs.map +0 -1
- package/dist/chunk-YPLZDWG7.js.map +0 -1
- package/dist/chunk-Z55SJVEC.cjs.map +0 -1
- package/dist/llm/model/is-v2-model.d.ts +0 -3
- package/dist/llm/model/is-v2-model.d.ts.map +0 -1
- package/dist/models-dev-D3EKFGAO.cjs +0 -12
- package/dist/models-dev-EO22XOXQ.js +0 -3
- package/dist/netlify-AE4LNCAI.js +0 -3
- package/dist/netlify-WE42TZIT.cjs +0 -12
- package/dist/provider-registry-6LF3NGC5.js +0 -3
- package/dist/provider-registry-73FKMXJV.cjs +0 -40
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chunkIXZ2T2QX_cjs = require('./chunk-IXZ2T2QX.cjs');
|
|
3
|
+
var chunkF75EQ574_cjs = require('./chunk-F75EQ574.cjs');
|
|
5
4
|
var z4 = require('zod/v4');
|
|
6
5
|
var v3 = require('zod/v3');
|
|
7
6
|
|
|
@@ -55,7 +54,7 @@ var createIdGenerator = ({
|
|
|
55
54
|
return generator;
|
|
56
55
|
}
|
|
57
56
|
if (alphabet.includes(separator)) {
|
|
58
|
-
throw new
|
|
57
|
+
throw new chunkF75EQ574_cjs.InvalidArgumentError({
|
|
59
58
|
argument: "separator",
|
|
60
59
|
message: `The separator "${separator}" must not be part of the alphabet "${alphabet}".`
|
|
61
60
|
});
|
|
@@ -79,7 +78,7 @@ function handleFetchError({
|
|
|
79
78
|
if (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES.includes(error.message.toLowerCase())) {
|
|
80
79
|
const cause = error.cause;
|
|
81
80
|
if (cause != null) {
|
|
82
|
-
return new
|
|
81
|
+
return new chunkF75EQ574_cjs.APICallError({
|
|
83
82
|
message: `Cannot connect to API: ${cause.message}`,
|
|
84
83
|
cause,
|
|
85
84
|
url,
|
|
@@ -148,23 +147,23 @@ function loadApiKey2({
|
|
|
148
147
|
return apiKey;
|
|
149
148
|
}
|
|
150
149
|
if (apiKey != null) {
|
|
151
|
-
throw new
|
|
150
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
152
151
|
message: `${description} API key must be a string.`
|
|
153
152
|
});
|
|
154
153
|
}
|
|
155
154
|
if (typeof process === "undefined") {
|
|
156
|
-
throw new
|
|
155
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
157
156
|
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables is not supported in this environment.`
|
|
158
157
|
});
|
|
159
158
|
}
|
|
160
159
|
apiKey = process.env[environmentVariableName];
|
|
161
160
|
if (apiKey == null) {
|
|
162
|
-
throw new
|
|
161
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
163
162
|
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.`
|
|
164
163
|
});
|
|
165
164
|
}
|
|
166
165
|
if (typeof apiKey !== "string") {
|
|
167
|
-
throw new
|
|
166
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
168
167
|
message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.`
|
|
169
168
|
});
|
|
170
169
|
}
|
|
@@ -232,7 +231,7 @@ function standardSchemaValidator(standardSchema) {
|
|
|
232
231
|
const result = await standardSchema["~standard"].validate(value);
|
|
233
232
|
return result.issues == null ? { success: true, value: result.value } : {
|
|
234
233
|
success: false,
|
|
235
|
-
error: new
|
|
234
|
+
error: new chunkF75EQ574_cjs.TypeValidationError({
|
|
236
235
|
value,
|
|
237
236
|
cause: result.issues
|
|
238
237
|
})
|
|
@@ -245,7 +244,7 @@ async function validateTypes({
|
|
|
245
244
|
}) {
|
|
246
245
|
const result = await safeValidateTypes({ value, schema });
|
|
247
246
|
if (!result.success) {
|
|
248
|
-
throw
|
|
247
|
+
throw chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error });
|
|
249
248
|
}
|
|
250
249
|
return result.value;
|
|
251
250
|
}
|
|
@@ -264,13 +263,13 @@ async function safeValidateTypes({
|
|
|
264
263
|
}
|
|
265
264
|
return {
|
|
266
265
|
success: false,
|
|
267
|
-
error:
|
|
266
|
+
error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error }),
|
|
268
267
|
rawValue: value
|
|
269
268
|
};
|
|
270
269
|
} catch (error) {
|
|
271
270
|
return {
|
|
272
271
|
success: false,
|
|
273
|
-
error:
|
|
272
|
+
error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: error }),
|
|
274
273
|
rawValue: value
|
|
275
274
|
};
|
|
276
275
|
}
|
|
@@ -286,10 +285,10 @@ async function parseJSON({
|
|
|
286
285
|
}
|
|
287
286
|
return validateTypes({ value, schema });
|
|
288
287
|
} catch (error) {
|
|
289
|
-
if (
|
|
288
|
+
if (chunkF75EQ574_cjs.JSONParseError.isInstance(error) || chunkF75EQ574_cjs.TypeValidationError.isInstance(error)) {
|
|
290
289
|
throw error;
|
|
291
290
|
}
|
|
292
|
-
throw new
|
|
291
|
+
throw new chunkF75EQ574_cjs.JSONParseError({ text, cause: error });
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
294
|
async function safeParseJSON({
|
|
@@ -305,7 +304,7 @@ async function safeParseJSON({
|
|
|
305
304
|
} catch (error) {
|
|
306
305
|
return {
|
|
307
306
|
success: false,
|
|
308
|
-
error:
|
|
307
|
+
error: chunkF75EQ574_cjs.JSONParseError.isInstance(error) ? error : new chunkF75EQ574_cjs.JSONParseError({ text, cause: error }),
|
|
309
308
|
rawValue: void 0
|
|
310
309
|
};
|
|
311
310
|
}
|
|
@@ -322,7 +321,7 @@ function parseJsonEventStream({
|
|
|
322
321
|
stream,
|
|
323
322
|
schema
|
|
324
323
|
}) {
|
|
325
|
-
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
324
|
+
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new chunkF75EQ574_cjs.EventSourceParserStream()).pipeThrough(
|
|
326
325
|
new TransformStream({
|
|
327
326
|
async transform({ data }, controller) {
|
|
328
327
|
if (data === "[DONE]") {
|
|
@@ -346,7 +345,7 @@ async function parseProviderOptions2({
|
|
|
346
345
|
schema
|
|
347
346
|
});
|
|
348
347
|
if (!parsedProviderOptions.success) {
|
|
349
|
-
throw new
|
|
348
|
+
throw new chunkF75EQ574_cjs.InvalidArgumentError({
|
|
350
349
|
argument: "providerOptions",
|
|
351
350
|
message: `invalid ${provider} provider options`,
|
|
352
351
|
cause: parsedProviderOptions.error
|
|
@@ -408,10 +407,10 @@ var postToApi = async ({
|
|
|
408
407
|
requestBodyValues: body.values
|
|
409
408
|
});
|
|
410
409
|
} catch (error) {
|
|
411
|
-
if (isAbortError(error) ||
|
|
410
|
+
if (isAbortError(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
|
|
412
411
|
throw error;
|
|
413
412
|
}
|
|
414
|
-
throw new
|
|
413
|
+
throw new chunkF75EQ574_cjs.APICallError({
|
|
415
414
|
message: "Failed to process error response",
|
|
416
415
|
cause: error,
|
|
417
416
|
statusCode: response.status,
|
|
@@ -430,11 +429,11 @@ var postToApi = async ({
|
|
|
430
429
|
});
|
|
431
430
|
} catch (error) {
|
|
432
431
|
if (error instanceof Error) {
|
|
433
|
-
if (isAbortError(error) ||
|
|
432
|
+
if (isAbortError(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
|
|
434
433
|
throw error;
|
|
435
434
|
}
|
|
436
435
|
}
|
|
437
|
-
throw new
|
|
436
|
+
throw new chunkF75EQ574_cjs.APICallError({
|
|
438
437
|
message: "Failed to process successful response",
|
|
439
438
|
cause: error,
|
|
440
439
|
statusCode: response.status,
|
|
@@ -457,7 +456,7 @@ var createJsonErrorResponseHandler2 = ({
|
|
|
457
456
|
if (responseBody.trim() === "") {
|
|
458
457
|
return {
|
|
459
458
|
responseHeaders,
|
|
460
|
-
value: new
|
|
459
|
+
value: new chunkF75EQ574_cjs.APICallError({
|
|
461
460
|
message: response.statusText,
|
|
462
461
|
url,
|
|
463
462
|
requestBodyValues,
|
|
@@ -475,7 +474,7 @@ var createJsonErrorResponseHandler2 = ({
|
|
|
475
474
|
});
|
|
476
475
|
return {
|
|
477
476
|
responseHeaders,
|
|
478
|
-
value: new
|
|
477
|
+
value: new chunkF75EQ574_cjs.APICallError({
|
|
479
478
|
message: errorToMessage2(parsedError),
|
|
480
479
|
url,
|
|
481
480
|
requestBodyValues,
|
|
@@ -489,7 +488,7 @@ var createJsonErrorResponseHandler2 = ({
|
|
|
489
488
|
} catch (parseError) {
|
|
490
489
|
return {
|
|
491
490
|
responseHeaders,
|
|
492
|
-
value: new
|
|
491
|
+
value: new chunkF75EQ574_cjs.APICallError({
|
|
493
492
|
message: response.statusText,
|
|
494
493
|
url,
|
|
495
494
|
requestBodyValues,
|
|
@@ -504,7 +503,7 @@ var createJsonErrorResponseHandler2 = ({
|
|
|
504
503
|
var createEventSourceResponseHandler2 = (chunkSchema) => async ({ response }) => {
|
|
505
504
|
const responseHeaders = extractResponseHeaders(response);
|
|
506
505
|
if (response.body == null) {
|
|
507
|
-
throw new
|
|
506
|
+
throw new chunkF75EQ574_cjs.EmptyResponseBodyError({});
|
|
508
507
|
}
|
|
509
508
|
return {
|
|
510
509
|
responseHeaders,
|
|
@@ -522,7 +521,7 @@ var createJsonResponseHandler2 = (responseSchema) => async ({ response, url, req
|
|
|
522
521
|
});
|
|
523
522
|
const responseHeaders = extractResponseHeaders(response);
|
|
524
523
|
if (!parsedResult.success) {
|
|
525
|
-
throw new
|
|
524
|
+
throw new chunkF75EQ574_cjs.APICallError({
|
|
526
525
|
message: "Invalid JSON response",
|
|
527
526
|
cause: parsedResult.error,
|
|
528
527
|
statusCode: response.status,
|
|
@@ -1954,7 +1953,7 @@ function prepareTools({
|
|
|
1954
1953
|
};
|
|
1955
1954
|
default: {
|
|
1956
1955
|
const _exhaustiveCheck = type;
|
|
1957
|
-
throw new
|
|
1956
|
+
throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
|
|
1958
1957
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
1959
1958
|
});
|
|
1960
1959
|
}
|
|
@@ -2243,13 +2242,13 @@ var DeepSeekChatLanguageModel = class {
|
|
|
2243
2242
|
const index = toolCallDelta.index;
|
|
2244
2243
|
if (toolCalls[index] == null) {
|
|
2245
2244
|
if (toolCallDelta.id == null) {
|
|
2246
|
-
throw new
|
|
2245
|
+
throw new chunkF75EQ574_cjs.InvalidResponseDataError({
|
|
2247
2246
|
data: toolCallDelta,
|
|
2248
2247
|
message: `Expected 'id' to be a string.`
|
|
2249
2248
|
});
|
|
2250
2249
|
}
|
|
2251
2250
|
if (((_a15 = toolCallDelta.function) == null ? void 0 : _a15.name) == null) {
|
|
2252
|
-
throw new
|
|
2251
|
+
throw new chunkF75EQ574_cjs.InvalidResponseDataError({
|
|
2253
2252
|
data: toolCallDelta,
|
|
2254
2253
|
message: `Expected 'function.name' to be a string.`
|
|
2255
2254
|
});
|
|
@@ -2397,10 +2396,10 @@ function createDeepSeek(options = {}) {
|
|
|
2397
2396
|
provider.languageModel = createLanguageModel;
|
|
2398
2397
|
provider.chat = createLanguageModel;
|
|
2399
2398
|
provider.textEmbeddingModel = (modelId) => {
|
|
2400
|
-
throw new
|
|
2399
|
+
throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
|
|
2401
2400
|
};
|
|
2402
2401
|
provider.imageModel = (modelId) => {
|
|
2403
|
-
throw new
|
|
2402
|
+
throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
|
|
2404
2403
|
};
|
|
2405
2404
|
return provider;
|
|
2406
2405
|
}
|
|
@@ -2428,7 +2427,7 @@ function convertToMistralChatMessages(prompt) {
|
|
|
2428
2427
|
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
2429
2428
|
return {
|
|
2430
2429
|
type: "image_url",
|
|
2431
|
-
image_url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${
|
|
2430
|
+
image_url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${chunkF75EQ574_cjs.convertToBase64(part.data)}`
|
|
2432
2431
|
};
|
|
2433
2432
|
} else if (part.mediaType === "application/pdf") {
|
|
2434
2433
|
return {
|
|
@@ -2436,7 +2435,7 @@ function convertToMistralChatMessages(prompt) {
|
|
|
2436
2435
|
document_url: part.data.toString()
|
|
2437
2436
|
};
|
|
2438
2437
|
} else {
|
|
2439
|
-
throw new
|
|
2438
|
+
throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
|
|
2440
2439
|
functionality: "Only images and PDF file parts are supported"
|
|
2441
2440
|
});
|
|
2442
2441
|
}
|
|
@@ -2577,7 +2576,7 @@ var mistralErrorDataSchema = z4.z.object({
|
|
|
2577
2576
|
param: z4.z.string().nullable(),
|
|
2578
2577
|
code: z4.z.string().nullable()
|
|
2579
2578
|
});
|
|
2580
|
-
var mistralFailedResponseHandler =
|
|
2579
|
+
var mistralFailedResponseHandler = chunkF75EQ574_cjs.createJsonErrorResponseHandler({
|
|
2581
2580
|
errorSchema: mistralErrorDataSchema,
|
|
2582
2581
|
errorToMessage: (data) => data.message
|
|
2583
2582
|
});
|
|
@@ -2627,7 +2626,7 @@ function prepareTools2({
|
|
|
2627
2626
|
};
|
|
2628
2627
|
default: {
|
|
2629
2628
|
const _exhaustiveCheck = type;
|
|
2630
|
-
throw new
|
|
2629
|
+
throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
|
|
2631
2630
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
2632
2631
|
});
|
|
2633
2632
|
}
|
|
@@ -2642,7 +2641,7 @@ var MistralChatLanguageModel = class {
|
|
|
2642
2641
|
var _a15;
|
|
2643
2642
|
this.modelId = modelId;
|
|
2644
2643
|
this.config = config;
|
|
2645
|
-
this.generateId = (_a15 = config.generateId) != null ? _a15 :
|
|
2644
|
+
this.generateId = (_a15 = config.generateId) != null ? _a15 : chunkF75EQ574_cjs.generateId;
|
|
2646
2645
|
}
|
|
2647
2646
|
get provider() {
|
|
2648
2647
|
return this.config.provider;
|
|
@@ -2664,7 +2663,7 @@ var MistralChatLanguageModel = class {
|
|
|
2664
2663
|
}) {
|
|
2665
2664
|
var _a15, _b, _c, _d;
|
|
2666
2665
|
const warnings = [];
|
|
2667
|
-
const options = (_a15 = await
|
|
2666
|
+
const options = (_a15 = await chunkF75EQ574_cjs.parseProviderOptions({
|
|
2668
2667
|
provider: "mistral",
|
|
2669
2668
|
providerOptions,
|
|
2670
2669
|
schema: mistralLanguageModelOptions
|
|
@@ -2696,7 +2695,7 @@ var MistralChatLanguageModel = class {
|
|
|
2696
2695
|
const structuredOutputs = (_b = options.structuredOutputs) != null ? _b : true;
|
|
2697
2696
|
const strictJsonSchema = (_c = options.strictJsonSchema) != null ? _c : false;
|
|
2698
2697
|
if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && !(responseFormat == null ? void 0 : responseFormat.schema)) {
|
|
2699
|
-
prompt =
|
|
2698
|
+
prompt = chunkF75EQ574_cjs.injectJsonInstructionIntoMessages({
|
|
2700
2699
|
messages: prompt,
|
|
2701
2700
|
schema: responseFormat.schema
|
|
2702
2701
|
});
|
|
@@ -2751,12 +2750,12 @@ var MistralChatLanguageModel = class {
|
|
|
2751
2750
|
responseHeaders,
|
|
2752
2751
|
value: response,
|
|
2753
2752
|
rawValue: rawResponse
|
|
2754
|
-
} = await
|
|
2753
|
+
} = await chunkF75EQ574_cjs.postJsonToApi({
|
|
2755
2754
|
url: `${this.config.baseURL}/chat/completions`,
|
|
2756
|
-
headers:
|
|
2755
|
+
headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
2757
2756
|
body,
|
|
2758
2757
|
failedResponseHandler: mistralFailedResponseHandler,
|
|
2759
|
-
successfulResponseHandler:
|
|
2758
|
+
successfulResponseHandler: chunkF75EQ574_cjs.createJsonResponseHandler(
|
|
2760
2759
|
mistralChatResponseSchema
|
|
2761
2760
|
),
|
|
2762
2761
|
abortSignal: options.abortSignal,
|
|
@@ -2813,12 +2812,12 @@ var MistralChatLanguageModel = class {
|
|
|
2813
2812
|
async doStream(options) {
|
|
2814
2813
|
const { args, warnings } = await this.getArgs(options);
|
|
2815
2814
|
const body = { ...args, stream: true };
|
|
2816
|
-
const { responseHeaders, value: response } = await
|
|
2815
|
+
const { responseHeaders, value: response } = await chunkF75EQ574_cjs.postJsonToApi({
|
|
2817
2816
|
url: `${this.config.baseURL}/chat/completions`,
|
|
2818
|
-
headers:
|
|
2817
|
+
headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
2819
2818
|
body,
|
|
2820
2819
|
failedResponseHandler: mistralFailedResponseHandler,
|
|
2821
|
-
successfulResponseHandler:
|
|
2820
|
+
successfulResponseHandler: chunkF75EQ574_cjs.createEventSourceResponseHandler(
|
|
2822
2821
|
mistralChatChunkSchema
|
|
2823
2822
|
),
|
|
2824
2823
|
abortSignal: options.abortSignal,
|
|
@@ -3091,7 +3090,7 @@ var MistralEmbeddingModel = class {
|
|
|
3091
3090
|
headers
|
|
3092
3091
|
}) {
|
|
3093
3092
|
if (values.length > this.maxEmbeddingsPerCall) {
|
|
3094
|
-
throw new
|
|
3093
|
+
throw new chunkF75EQ574_cjs.TooManyEmbeddingValuesForCallError({
|
|
3095
3094
|
provider: this.provider,
|
|
3096
3095
|
modelId: this.modelId,
|
|
3097
3096
|
maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,
|
|
@@ -3102,16 +3101,16 @@ var MistralEmbeddingModel = class {
|
|
|
3102
3101
|
responseHeaders,
|
|
3103
3102
|
value: response,
|
|
3104
3103
|
rawValue
|
|
3105
|
-
} = await
|
|
3104
|
+
} = await chunkF75EQ574_cjs.postJsonToApi({
|
|
3106
3105
|
url: `${this.config.baseURL}/embeddings`,
|
|
3107
|
-
headers:
|
|
3106
|
+
headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), headers),
|
|
3108
3107
|
body: {
|
|
3109
3108
|
model: this.modelId,
|
|
3110
3109
|
input: values,
|
|
3111
3110
|
encoding_format: "float"
|
|
3112
3111
|
},
|
|
3113
3112
|
failedResponseHandler: mistralFailedResponseHandler,
|
|
3114
|
-
successfulResponseHandler:
|
|
3113
|
+
successfulResponseHandler: chunkF75EQ574_cjs.createJsonResponseHandler(
|
|
3115
3114
|
MistralTextEmbeddingResponseSchema
|
|
3116
3115
|
),
|
|
3117
3116
|
abortSignal,
|
|
@@ -3131,10 +3130,10 @@ var MistralTextEmbeddingResponseSchema = z4.z.object({
|
|
|
3131
3130
|
var VERSION3 = "2.0.24" ;
|
|
3132
3131
|
function createMistral(options = {}) {
|
|
3133
3132
|
var _a15;
|
|
3134
|
-
const baseURL = (_a15 =
|
|
3135
|
-
const getHeaders = () =>
|
|
3133
|
+
const baseURL = (_a15 = chunkF75EQ574_cjs.withoutTrailingSlash(options.baseURL)) != null ? _a15 : "https://api.mistral.ai/v1";
|
|
3134
|
+
const getHeaders = () => chunkF75EQ574_cjs.withUserAgentSuffix(
|
|
3136
3135
|
{
|
|
3137
|
-
Authorization: `Bearer ${
|
|
3136
|
+
Authorization: `Bearer ${chunkF75EQ574_cjs.loadApiKey({
|
|
3138
3137
|
apiKey: options.apiKey,
|
|
3139
3138
|
environmentVariableName: "MISTRAL_API_KEY",
|
|
3140
3139
|
description: "Mistral"
|
|
@@ -3170,7 +3169,7 @@ function createMistral(options = {}) {
|
|
|
3170
3169
|
provider.textEmbedding = createEmbeddingModel;
|
|
3171
3170
|
provider.textEmbeddingModel = createEmbeddingModel;
|
|
3172
3171
|
provider.imageModel = (modelId) => {
|
|
3173
|
-
throw new
|
|
3172
|
+
throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
|
|
3174
3173
|
};
|
|
3175
3174
|
return provider;
|
|
3176
3175
|
}
|
|
@@ -3210,7 +3209,7 @@ var createIdGenerator2 = ({
|
|
|
3210
3209
|
return generator;
|
|
3211
3210
|
}
|
|
3212
3211
|
if (alphabet.includes(separator)) {
|
|
3213
|
-
throw new
|
|
3212
|
+
throw new chunkF75EQ574_cjs.InvalidArgumentError({
|
|
3214
3213
|
argument: "separator",
|
|
3215
3214
|
message: `The separator "${separator}" must not be part of the alphabet "${alphabet}".`
|
|
3216
3215
|
});
|
|
@@ -3234,7 +3233,7 @@ function handleFetchError2({
|
|
|
3234
3233
|
if (error instanceof TypeError && FETCH_FAILED_ERROR_MESSAGES2.includes(error.message.toLowerCase())) {
|
|
3235
3234
|
const cause = error.cause;
|
|
3236
3235
|
if (cause != null) {
|
|
3237
|
-
return new
|
|
3236
|
+
return new chunkF75EQ574_cjs.APICallError({
|
|
3238
3237
|
message: `Cannot connect to API: ${cause.message}`,
|
|
3239
3238
|
cause,
|
|
3240
3239
|
url,
|
|
@@ -3261,23 +3260,23 @@ function loadApiKey3({
|
|
|
3261
3260
|
return apiKey;
|
|
3262
3261
|
}
|
|
3263
3262
|
if (apiKey != null) {
|
|
3264
|
-
throw new
|
|
3263
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
3265
3264
|
message: `${description} API key must be a string.`
|
|
3266
3265
|
});
|
|
3267
3266
|
}
|
|
3268
3267
|
if (typeof process === "undefined") {
|
|
3269
|
-
throw new
|
|
3268
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
3270
3269
|
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter. Environment variables is not supported in this environment.`
|
|
3271
3270
|
});
|
|
3272
3271
|
}
|
|
3273
3272
|
apiKey = process.env[environmentVariableName];
|
|
3274
3273
|
if (apiKey == null) {
|
|
3275
|
-
throw new
|
|
3274
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
3276
3275
|
message: `${description} API key is missing. Pass it using the '${apiKeyParameterName}' parameter or the ${environmentVariableName} environment variable.`
|
|
3277
3276
|
});
|
|
3278
3277
|
}
|
|
3279
3278
|
if (typeof apiKey !== "string") {
|
|
3280
|
-
throw new
|
|
3279
|
+
throw new chunkF75EQ574_cjs.LoadAPIKeyError({
|
|
3281
3280
|
message: `${description} API key must be a string. The value of the ${environmentVariableName} environment variable is not a string.`
|
|
3282
3281
|
});
|
|
3283
3282
|
}
|
|
@@ -3341,7 +3340,7 @@ function standardSchemaValidator2(standardSchema) {
|
|
|
3341
3340
|
const result = await standardSchema["~standard"].validate(value);
|
|
3342
3341
|
return result.issues == null ? { success: true, value: result.value } : {
|
|
3343
3342
|
success: false,
|
|
3344
|
-
error: new
|
|
3343
|
+
error: new chunkF75EQ574_cjs.TypeValidationError({
|
|
3345
3344
|
value,
|
|
3346
3345
|
cause: result.issues
|
|
3347
3346
|
})
|
|
@@ -3354,7 +3353,7 @@ async function validateTypes2({
|
|
|
3354
3353
|
}) {
|
|
3355
3354
|
const result = await safeValidateTypes2({ value, schema });
|
|
3356
3355
|
if (!result.success) {
|
|
3357
|
-
throw
|
|
3356
|
+
throw chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error });
|
|
3358
3357
|
}
|
|
3359
3358
|
return result.value;
|
|
3360
3359
|
}
|
|
@@ -3373,13 +3372,13 @@ async function safeValidateTypes2({
|
|
|
3373
3372
|
}
|
|
3374
3373
|
return {
|
|
3375
3374
|
success: false,
|
|
3376
|
-
error:
|
|
3375
|
+
error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: result.error }),
|
|
3377
3376
|
rawValue: value
|
|
3378
3377
|
};
|
|
3379
3378
|
} catch (error) {
|
|
3380
3379
|
return {
|
|
3381
3380
|
success: false,
|
|
3382
|
-
error:
|
|
3381
|
+
error: chunkF75EQ574_cjs.TypeValidationError.wrap({ value, cause: error }),
|
|
3383
3382
|
rawValue: value
|
|
3384
3383
|
};
|
|
3385
3384
|
}
|
|
@@ -3395,10 +3394,10 @@ async function parseJSON2({
|
|
|
3395
3394
|
}
|
|
3396
3395
|
return validateTypes2({ value, schema });
|
|
3397
3396
|
} catch (error) {
|
|
3398
|
-
if (
|
|
3397
|
+
if (chunkF75EQ574_cjs.JSONParseError.isInstance(error) || chunkF75EQ574_cjs.TypeValidationError.isInstance(error)) {
|
|
3399
3398
|
throw error;
|
|
3400
3399
|
}
|
|
3401
|
-
throw new
|
|
3400
|
+
throw new chunkF75EQ574_cjs.JSONParseError({ text, cause: error });
|
|
3402
3401
|
}
|
|
3403
3402
|
}
|
|
3404
3403
|
async function safeParseJSON2({
|
|
@@ -3414,7 +3413,7 @@ async function safeParseJSON2({
|
|
|
3414
3413
|
} catch (error) {
|
|
3415
3414
|
return {
|
|
3416
3415
|
success: false,
|
|
3417
|
-
error:
|
|
3416
|
+
error: chunkF75EQ574_cjs.JSONParseError.isInstance(error) ? error : new chunkF75EQ574_cjs.JSONParseError({ text, cause: error }),
|
|
3418
3417
|
rawValue: void 0
|
|
3419
3418
|
};
|
|
3420
3419
|
}
|
|
@@ -3423,7 +3422,7 @@ function parseJsonEventStream2({
|
|
|
3423
3422
|
stream,
|
|
3424
3423
|
schema
|
|
3425
3424
|
}) {
|
|
3426
|
-
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new
|
|
3425
|
+
return stream.pipeThrough(new TextDecoderStream()).pipeThrough(new chunkF75EQ574_cjs.EventSourceParserStream()).pipeThrough(
|
|
3427
3426
|
new TransformStream({
|
|
3428
3427
|
async transform({ data }, controller) {
|
|
3429
3428
|
if (data === "[DONE]") {
|
|
@@ -3484,10 +3483,10 @@ var postToApi2 = async ({
|
|
|
3484
3483
|
requestBodyValues: body.values
|
|
3485
3484
|
});
|
|
3486
3485
|
} catch (error) {
|
|
3487
|
-
if (isAbortError2(error) ||
|
|
3486
|
+
if (isAbortError2(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
|
|
3488
3487
|
throw error;
|
|
3489
3488
|
}
|
|
3490
|
-
throw new
|
|
3489
|
+
throw new chunkF75EQ574_cjs.APICallError({
|
|
3491
3490
|
message: "Failed to process error response",
|
|
3492
3491
|
cause: error,
|
|
3493
3492
|
statusCode: response.status,
|
|
@@ -3506,11 +3505,11 @@ var postToApi2 = async ({
|
|
|
3506
3505
|
});
|
|
3507
3506
|
} catch (error) {
|
|
3508
3507
|
if (error instanceof Error) {
|
|
3509
|
-
if (isAbortError2(error) ||
|
|
3508
|
+
if (isAbortError2(error) || chunkF75EQ574_cjs.APICallError.isInstance(error)) {
|
|
3510
3509
|
throw error;
|
|
3511
3510
|
}
|
|
3512
3511
|
}
|
|
3513
|
-
throw new
|
|
3512
|
+
throw new chunkF75EQ574_cjs.APICallError({
|
|
3514
3513
|
message: "Failed to process successful response",
|
|
3515
3514
|
cause: error,
|
|
3516
3515
|
statusCode: response.status,
|
|
@@ -3533,7 +3532,7 @@ var createJsonErrorResponseHandler3 = ({
|
|
|
3533
3532
|
if (responseBody.trim() === "") {
|
|
3534
3533
|
return {
|
|
3535
3534
|
responseHeaders,
|
|
3536
|
-
value: new
|
|
3535
|
+
value: new chunkF75EQ574_cjs.APICallError({
|
|
3537
3536
|
message: response.statusText,
|
|
3538
3537
|
url,
|
|
3539
3538
|
requestBodyValues,
|
|
@@ -3551,7 +3550,7 @@ var createJsonErrorResponseHandler3 = ({
|
|
|
3551
3550
|
});
|
|
3552
3551
|
return {
|
|
3553
3552
|
responseHeaders,
|
|
3554
|
-
value: new
|
|
3553
|
+
value: new chunkF75EQ574_cjs.APICallError({
|
|
3555
3554
|
message: errorToMessage2(parsedError),
|
|
3556
3555
|
url,
|
|
3557
3556
|
requestBodyValues,
|
|
@@ -3565,7 +3564,7 @@ var createJsonErrorResponseHandler3 = ({
|
|
|
3565
3564
|
} catch (parseError) {
|
|
3566
3565
|
return {
|
|
3567
3566
|
responseHeaders,
|
|
3568
|
-
value: new
|
|
3567
|
+
value: new chunkF75EQ574_cjs.APICallError({
|
|
3569
3568
|
message: response.statusText,
|
|
3570
3569
|
url,
|
|
3571
3570
|
requestBodyValues,
|
|
@@ -3580,7 +3579,7 @@ var createJsonErrorResponseHandler3 = ({
|
|
|
3580
3579
|
var createEventSourceResponseHandler3 = (chunkSchema) => async ({ response }) => {
|
|
3581
3580
|
const responseHeaders = extractResponseHeaders2(response);
|
|
3582
3581
|
if (response.body == null) {
|
|
3583
|
-
throw new
|
|
3582
|
+
throw new chunkF75EQ574_cjs.EmptyResponseBodyError({});
|
|
3584
3583
|
}
|
|
3585
3584
|
return {
|
|
3586
3585
|
responseHeaders,
|
|
@@ -3598,7 +3597,7 @@ var createJsonResponseHandler3 = (responseSchema) => async ({ response, url, req
|
|
|
3598
3597
|
});
|
|
3599
3598
|
const responseHeaders = extractResponseHeaders2(response);
|
|
3600
3599
|
if (!parsedResult.success) {
|
|
3601
|
-
throw new
|
|
3600
|
+
throw new chunkF75EQ574_cjs.APICallError({
|
|
3602
3601
|
message: "Invalid JSON response",
|
|
3603
3602
|
cause: parsedResult.error,
|
|
3604
3603
|
statusCode: response.status,
|
|
@@ -3669,7 +3668,7 @@ function convertToPerplexityMessages(prompt) {
|
|
|
3669
3668
|
break;
|
|
3670
3669
|
}
|
|
3671
3670
|
case "tool": {
|
|
3672
|
-
throw new
|
|
3671
|
+
throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
|
|
3673
3672
|
functionality: "Tool messages"
|
|
3674
3673
|
});
|
|
3675
3674
|
}
|
|
@@ -4038,10 +4037,10 @@ function createPerplexity(options = {}) {
|
|
|
4038
4037
|
const provider = (modelId) => createLanguageModel(modelId);
|
|
4039
4038
|
provider.languageModel = createLanguageModel;
|
|
4040
4039
|
provider.textEmbeddingModel = (modelId) => {
|
|
4041
|
-
throw new
|
|
4040
|
+
throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
|
|
4042
4041
|
};
|
|
4043
4042
|
provider.imageModel = (modelId) => {
|
|
4044
|
-
throw new
|
|
4043
|
+
throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "imageModel" });
|
|
4045
4044
|
};
|
|
4046
4045
|
return provider;
|
|
4047
4046
|
}
|
|
@@ -4073,11 +4072,11 @@ function convertToXaiChatMessages(prompt) {
|
|
|
4073
4072
|
return {
|
|
4074
4073
|
type: "image_url",
|
|
4075
4074
|
image_url: {
|
|
4076
|
-
url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${
|
|
4075
|
+
url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${chunkF75EQ574_cjs.convertToBase64(part.data)}`
|
|
4077
4076
|
}
|
|
4078
4077
|
};
|
|
4079
4078
|
} else {
|
|
4080
|
-
throw new
|
|
4079
|
+
throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
|
|
4081
4080
|
functionality: `file part media type ${part.mediaType}`
|
|
4082
4081
|
});
|
|
4083
4082
|
}
|
|
@@ -4258,7 +4257,7 @@ var xaiErrorDataSchema = z4.z.object({
|
|
|
4258
4257
|
code: z4.z.union([z4.z.string(), z4.z.number()]).nullish()
|
|
4259
4258
|
})
|
|
4260
4259
|
});
|
|
4261
|
-
var xaiFailedResponseHandler =
|
|
4260
|
+
var xaiFailedResponseHandler = chunkF75EQ574_cjs.createJsonErrorResponseHandler({
|
|
4262
4261
|
errorSchema: xaiErrorDataSchema,
|
|
4263
4262
|
errorToMessage: (data) => data.error.message
|
|
4264
4263
|
});
|
|
@@ -4307,7 +4306,7 @@ function prepareTools3({
|
|
|
4307
4306
|
};
|
|
4308
4307
|
default: {
|
|
4309
4308
|
const _exhaustiveCheck = type;
|
|
4310
|
-
throw new
|
|
4309
|
+
throw new chunkF75EQ574_cjs.UnsupportedFunctionalityError({
|
|
4311
4310
|
functionality: `tool choice type: ${_exhaustiveCheck}`
|
|
4312
4311
|
});
|
|
4313
4312
|
}
|
|
@@ -4342,7 +4341,7 @@ var XaiChatLanguageModel = class {
|
|
|
4342
4341
|
}) {
|
|
4343
4342
|
var _a15, _b, _c;
|
|
4344
4343
|
const warnings = [];
|
|
4345
|
-
const options = (_a15 = await
|
|
4344
|
+
const options = (_a15 = await chunkF75EQ574_cjs.parseProviderOptions({
|
|
4346
4345
|
provider: "xai",
|
|
4347
4346
|
providerOptions,
|
|
4348
4347
|
schema: xaiProviderOptions
|
|
@@ -4454,12 +4453,12 @@ var XaiChatLanguageModel = class {
|
|
|
4454
4453
|
responseHeaders,
|
|
4455
4454
|
value: response,
|
|
4456
4455
|
rawValue: rawResponse
|
|
4457
|
-
} = await
|
|
4456
|
+
} = await chunkF75EQ574_cjs.postJsonToApi({
|
|
4458
4457
|
url: `${(_a15 = this.config.baseURL) != null ? _a15 : "https://api.x.ai/v1"}/chat/completions`,
|
|
4459
|
-
headers:
|
|
4458
|
+
headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
4460
4459
|
body,
|
|
4461
4460
|
failedResponseHandler: xaiFailedResponseHandler,
|
|
4462
|
-
successfulResponseHandler:
|
|
4461
|
+
successfulResponseHandler: chunkF75EQ574_cjs.createJsonResponseHandler(
|
|
4463
4462
|
xaiChatResponseSchema
|
|
4464
4463
|
),
|
|
4465
4464
|
abortSignal: options.abortSignal,
|
|
@@ -4531,12 +4530,12 @@ var XaiChatLanguageModel = class {
|
|
|
4531
4530
|
include_usage: true
|
|
4532
4531
|
}
|
|
4533
4532
|
};
|
|
4534
|
-
const { responseHeaders, value: response } = await
|
|
4533
|
+
const { responseHeaders, value: response } = await chunkF75EQ574_cjs.postJsonToApi({
|
|
4535
4534
|
url: `${(_a15 = this.config.baseURL) != null ? _a15 : "https://api.x.ai/v1"}/chat/completions`,
|
|
4536
|
-
headers:
|
|
4535
|
+
headers: chunkF75EQ574_cjs.combineHeaders(this.config.headers(), options.headers),
|
|
4537
4536
|
body,
|
|
4538
4537
|
failedResponseHandler: xaiFailedResponseHandler,
|
|
4539
|
-
successfulResponseHandler:
|
|
4538
|
+
successfulResponseHandler: chunkF75EQ574_cjs.createEventSourceResponseHandler(xaiChatChunkSchema),
|
|
4540
4539
|
abortSignal: options.abortSignal,
|
|
4541
4540
|
fetch: this.config.fetch
|
|
4542
4541
|
});
|
|
@@ -4751,12 +4750,12 @@ var xaiErrorStructure = {
|
|
|
4751
4750
|
};
|
|
4752
4751
|
function createXai(options = {}) {
|
|
4753
4752
|
var _a15;
|
|
4754
|
-
const baseURL =
|
|
4753
|
+
const baseURL = chunkF75EQ574_cjs.withoutTrailingSlash(
|
|
4755
4754
|
(_a15 = options.baseURL) != null ? _a15 : "https://api.x.ai/v1"
|
|
4756
4755
|
);
|
|
4757
|
-
const getHeaders = () =>
|
|
4756
|
+
const getHeaders = () => chunkF75EQ574_cjs.withUserAgentSuffix(
|
|
4758
4757
|
{
|
|
4759
|
-
Authorization: `Bearer ${
|
|
4758
|
+
Authorization: `Bearer ${chunkF75EQ574_cjs.loadApiKey({
|
|
4760
4759
|
apiKey: options.apiKey,
|
|
4761
4760
|
environmentVariableName: "XAI_API_KEY",
|
|
4762
4761
|
description: "xAI API key"
|
|
@@ -4770,12 +4769,12 @@ function createXai(options = {}) {
|
|
|
4770
4769
|
provider: "xai.chat",
|
|
4771
4770
|
baseURL,
|
|
4772
4771
|
headers: getHeaders,
|
|
4773
|
-
generateId:
|
|
4772
|
+
generateId: chunkF75EQ574_cjs.generateId,
|
|
4774
4773
|
fetch: options.fetch
|
|
4775
4774
|
});
|
|
4776
4775
|
};
|
|
4777
4776
|
const createImageModel = (modelId) => {
|
|
4778
|
-
return new
|
|
4777
|
+
return new chunkF75EQ574_cjs.OpenAICompatibleImageModel(modelId, {
|
|
4779
4778
|
provider: "xai.image",
|
|
4780
4779
|
url: ({ path }) => `${baseURL}${path}`,
|
|
4781
4780
|
headers: getHeaders,
|
|
@@ -4787,7 +4786,7 @@ function createXai(options = {}) {
|
|
|
4787
4786
|
provider.languageModel = createLanguageModel;
|
|
4788
4787
|
provider.chat = createLanguageModel;
|
|
4789
4788
|
provider.textEmbeddingModel = (modelId) => {
|
|
4790
|
-
throw new
|
|
4789
|
+
throw new chunkF75EQ574_cjs.NoSuchModelError({ modelId, modelType: "textEmbeddingModel" });
|
|
4791
4790
|
};
|
|
4792
4791
|
provider.imageModel = createImageModel;
|
|
4793
4792
|
provider.image = createImageModel;
|
|
@@ -7317,7 +7316,7 @@ var OPENAI_COMPATIBLE_OVERRIDES = {
|
|
|
7317
7316
|
apiKeyEnvVar: "AI_GATEWAY_API_KEY"
|
|
7318
7317
|
}
|
|
7319
7318
|
};
|
|
7320
|
-
var ModelsDevGateway = class extends
|
|
7319
|
+
var ModelsDevGateway = class extends chunkF75EQ574_cjs.MastraModelGateway {
|
|
7321
7320
|
id = "models.dev";
|
|
7322
7321
|
name = "models.dev";
|
|
7323
7322
|
providerConfigs = {};
|
|
@@ -7397,14 +7396,14 @@ var ModelsDevGateway = class extends chunkOWIEOL55_cjs.MastraModelGateway {
|
|
|
7397
7396
|
const baseURL = this.buildUrl(`${providerId}/${modelId}`);
|
|
7398
7397
|
switch (providerId) {
|
|
7399
7398
|
case "openai":
|
|
7400
|
-
return
|
|
7399
|
+
return chunkF75EQ574_cjs.createOpenAI({ apiKey }).responses(modelId);
|
|
7401
7400
|
case "gemini":
|
|
7402
7401
|
case "google":
|
|
7403
|
-
return
|
|
7402
|
+
return chunkF75EQ574_cjs.createGoogleGenerativeAI({
|
|
7404
7403
|
apiKey
|
|
7405
7404
|
}).chat(modelId);
|
|
7406
7405
|
case "anthropic":
|
|
7407
|
-
return
|
|
7406
|
+
return chunkF75EQ574_cjs.createAnthropic({ apiKey })(modelId);
|
|
7408
7407
|
case "mistral":
|
|
7409
7408
|
return createMistral({ apiKey })(modelId);
|
|
7410
7409
|
case "openrouter":
|
|
@@ -7421,7 +7420,7 @@ var ModelsDevGateway = class extends chunkOWIEOL55_cjs.MastraModelGateway {
|
|
|
7421
7420
|
return createPerplexity({ apiKey })(modelId);
|
|
7422
7421
|
default:
|
|
7423
7422
|
if (!baseURL) throw new Error(`No API URL found for ${providerId}/${modelId}`);
|
|
7424
|
-
return
|
|
7423
|
+
return chunkF75EQ574_cjs.createOpenAICompatible({ name: providerId, apiKey, baseURL, supportsStructuredOutputs: true }).chatModel(
|
|
7425
7424
|
modelId
|
|
7426
7425
|
);
|
|
7427
7426
|
}
|
|
@@ -7430,5 +7429,5 @@ var ModelsDevGateway = class extends chunkOWIEOL55_cjs.MastraModelGateway {
|
|
|
7430
7429
|
|
|
7431
7430
|
exports.ModelsDevGateway = ModelsDevGateway;
|
|
7432
7431
|
exports.parseModelRouterId = parseModelRouterId;
|
|
7433
|
-
//# sourceMappingURL=chunk-
|
|
7434
|
-
//# sourceMappingURL=chunk-
|
|
7432
|
+
//# sourceMappingURL=chunk-AAX7ZOM7.cjs.map
|
|
7433
|
+
//# sourceMappingURL=chunk-AAX7ZOM7.cjs.map
|