eve 0.59.0 → 0.60.0

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.
Files changed (366) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/src/approval/definition.d.ts +2 -0
  3. package/dist/src/cli/commands/init.js +1 -1
  4. package/dist/src/compiled/.vendor-stamp.json +9 -9
  5. package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +133 -7
  6. package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -2
  7. package/dist/src/compiled/@ai-sdk/google/index.d.ts +46 -5
  8. package/dist/src/compiled/@ai-sdk/google/index.js +9 -9
  9. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -1
  10. package/dist/src/compiled/@ai-sdk/openai/index.d.ts +186 -37
  11. package/dist/src/compiled/@ai-sdk/openai/index.js +4 -4
  12. package/dist/src/compiled/@ai-sdk/otel/index.js +3 -3
  13. package/dist/src/compiled/@ai-sdk/provider/index.d.ts +2186 -1889
  14. package/dist/src/compiled/@ai-sdk/provider/index.js +3 -3
  15. package/dist/src/compiled/@ai-sdk/provider-utils/index.d.ts +35 -1
  16. package/dist/src/compiled/@chat-adapter/slack/index.js +28 -28
  17. package/dist/src/compiled/@chat-adapter/twilio/index.js +1 -1
  18. package/dist/src/compiled/@linqapp/chat-sdk-adapter/index.js +2 -2
  19. package/dist/src/compiled/@modelcontextprotocol/server/index.js +2 -2
  20. package/dist/src/compiled/@opentelemetry/otlp-transformer/index.js +1 -1
  21. package/dist/src/compiled/@photon-ai/chat-adapter-imessage/index.js +61 -60
  22. package/dist/src/compiled/@vercel/blob/index.js +11 -11
  23. package/dist/src/compiled/@vercel/oidc/index.js +2 -2
  24. package/dist/src/compiled/@vercel/sandbox/index.js +2 -2
  25. package/dist/src/compiled/@workflow/core/index.js +1 -1
  26. package/dist/src/compiled/@workflow/core/runtime/helpers.js +1 -1
  27. package/dist/src/compiled/@workflow/core/runtime.js +3 -3
  28. package/dist/src/compiled/@workflow/core/serialization.js +1 -1
  29. package/dist/src/compiled/@workflow/core/workflow.js +1 -1
  30. package/dist/src/compiled/@workflow/world-local/index.js +3 -3
  31. package/dist/src/compiled/@workflow/world-vercel/index.js +13 -13
  32. package/dist/src/compiled/_chunks/node/{dist-CyWgAg5-.js → dist-CweJdVFE.js} +1 -1
  33. package/dist/src/compiled/_chunks/node/{dist-PazOnsjy.js → dist-Da54NuK8.js} +27 -28
  34. package/dist/src/compiled/_chunks/node/undici-h5GH4RBM.js +95 -0
  35. package/dist/src/compiled/_chunks/workflow/{attribute-changes-DTFAjP0J.js → attribute-changes-3SKHZsSX.js} +1 -1
  36. package/dist/src/compiled/_chunks/workflow/coerce-D0oqvQ_w.js +1 -0
  37. package/dist/src/compiled/_chunks/workflow/dist-C3919PVU.js +25 -0
  38. package/dist/src/compiled/_chunks/workflow/dist-DearXsdS.js +2 -0
  39. package/dist/src/compiled/_chunks/workflow/experimental-evaluation-D8_K_Pe9.js +5 -0
  40. package/dist/src/compiled/_chunks/workflow/{frames-DJw9L4rO.js → frames-Bm_yZi8X.js} +2 -2
  41. package/dist/src/compiled/_chunks/workflow/{functions-wMCGZAVk.js → functions-C06vHfWP.js} +1 -1
  42. package/dist/src/compiled/_chunks/workflow/{helpers-ClCA9Lmc.js → helpers-K7otPd_U.js} +1 -1
  43. package/dist/src/compiled/_chunks/workflow/{logger-D6vwIEf9.js → logger-CxBCNokg.js} +1 -1
  44. package/dist/src/compiled/_chunks/workflow/{resume-hook-_baK8jaT.js → resume-hook-B7_MC7FC.js} +1 -1
  45. package/dist/src/compiled/_chunks/workflow/{run-CRdL17z4.js → run-jGFog1uQ.js} +1 -1
  46. package/dist/src/compiled/_chunks/workflow/{schemas-DR7NTzNe.js → schemas-4CmFgxN_.js} +1 -1
  47. package/dist/src/compiled/_chunks/workflow/{serialization-CWYPL4Eq.js → serialization-VRHEKI6l.js} +2 -2
  48. package/dist/src/compiled/_chunks/workflow/{signal-exit-Dsy-TT0V.js → signal-exit-B9U6kH7R.js} +2 -2
  49. package/dist/src/compiled/_chunks/workflow/sleep-60eDbac6.js +1 -0
  50. package/dist/src/compiled/_chunks/workflow/{token-D8tWQnPx.js → token-U5XEWlVM.js} +1 -1
  51. package/dist/src/compiled/_chunks/workflow/{token-util-B0OPd7oj.js → token-util-pP4KRRl0.js} +2 -2
  52. package/dist/src/compiled/_chunks/workflow/{wait-until-DyIt9lEx.js → wait-until-DDJySKt-.js} +1 -1
  53. package/dist/src/compiled/_chunks/workflow/{ws-transport-Dl5FG4Sw.js → ws-transport-CEFNBXPC.js} +1 -1
  54. package/dist/src/compiled/chat/index.js +1 -1
  55. package/dist/src/compiled/chokidar/index.js +1 -1
  56. package/dist/src/compiled/env-runner/node-worker.js +3 -3
  57. package/dist/src/compiled/gray-matter/index.js +13 -13
  58. package/dist/src/compiled/shadcn-registry/index.js +2625 -444
  59. package/dist/src/compiler/default-tool-policy.d.ts +3 -1
  60. package/dist/src/compiler/default-tool-policy.js +1 -1
  61. package/dist/src/compiler/extension-compatibility.d.ts +16 -8
  62. package/dist/src/compiler/extension-compatibility.js +1 -1
  63. package/dist/src/compiler/manifest.d.ts +8 -2
  64. package/dist/src/compiler/manifest.js +1 -1
  65. package/dist/src/compiler/normalize-agent-config.js +1 -1
  66. package/dist/src/compiler/normalize-manifest-helpers.js +1 -1
  67. package/dist/src/compiler/normalize-manifest.js +1 -1
  68. package/dist/src/compiler/normalize-subagent.d.ts +1 -0
  69. package/dist/src/compiler/normalize-subagent.js +1 -1
  70. package/dist/src/compiler/remote-agent-node.d.ts +1 -0
  71. package/dist/src/compiler/remote-agent-node.js +1 -1
  72. package/dist/src/compiler/source-graph.d.ts +1 -0
  73. package/dist/src/compiler/source-graph.js +1 -1
  74. package/dist/src/context/dynamic-subagent-lifecycle.js +1 -1
  75. package/dist/src/evals/autoevals-client.js +1 -1
  76. package/dist/src/evals/expect/index.js +1 -1
  77. package/dist/src/evals/judge.js +1 -1
  78. package/dist/src/execution/dynamic-workflow/tool.js +1 -1
  79. package/dist/src/execution/session/turn-step.js +1 -1
  80. package/dist/src/execution/tools/sleep-workflow.js +1 -1
  81. package/dist/src/framework/sources/registry.js +1 -1
  82. package/dist/src/harness/compaction.js +1 -1
  83. package/dist/src/harness/tool-loop.js +2 -2
  84. package/dist/src/harness/tools.d.ts +1 -1
  85. package/dist/src/harness/tools.js +1 -1
  86. package/dist/src/instrumentation/ai-sdk-telemetry.js +1 -1
  87. package/dist/src/internal/application/package.js +1 -1
  88. package/dist/src/internal/authored-definition/core.js +1 -1
  89. package/dist/src/internal/model-auth/transport.js +1 -1
  90. package/dist/src/internal/nitro/host/extension-capability-requirements.js +1 -1
  91. package/dist/src/{experimental/evaluate/auto-model.d.ts → models/auto.d.ts} +3 -3
  92. package/dist/src/models/auto.js +2 -0
  93. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +1 -1
  94. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -1
  95. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +1 -1
  96. package/dist/src/node_modules/.pnpm/{autoevals@0.0.132_ws@8.21.3_bufferutil@4.1.0_ → autoevals@0.0.132_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0_}/node_modules/autoevals/jsdist/index.js +1 -1
  97. package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/index.js +1 -0
  98. package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/schemes.js +1 -0
  99. package/dist/src/node_modules/.pnpm/fast-uri@3.1.8/node_modules/fast-uri/lib/utils.js +1 -0
  100. package/dist/src/node_modules/.pnpm/js-yaml@4.3.2/node_modules/js-yaml/dist/js-yaml.js +34 -0
  101. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +1 -0
  102. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/azure.js +1 -0
  103. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/bedrock.js +1 -0
  104. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/client.js +11 -0
  105. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/streaming.js +1 -1
  106. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/uploads.js +1 -0
  107. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/index.js +1 -0
  108. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/headers.js +1 -0
  109. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/provider.js +1 -0
  110. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/uploads.js +2 -0
  111. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/log.js +1 -1
  112. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +1 -0
  113. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AssistantStream.js +1 -0
  114. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/ChatCompletionRunner.js +1 -1
  115. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +1 -0
  116. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +1 -0
  117. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/EventStream.js +1 -0
  118. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +1 -0
  119. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseAccumulator.js +1 -0
  120. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +1 -0
  121. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +1 -0
  122. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +1 -0
  123. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.js +1 -0
  124. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.js +1 -0
  125. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +1 -0
  126. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-limit.js +1 -0
  127. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +1 -0
  128. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-limit.js +1 -0
  129. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/speech.js +1 -1
  130. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/assistants.js +1 -1
  131. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/beta.js +1 -0
  132. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/sessions.js +1 -1
  133. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/threads.js +1 -1
  134. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/sessions.js +1 -1
  135. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/transcription-sessions.js +1 -1
  136. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/input-items.js +1 -0
  137. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/input-tokens.js +1 -0
  138. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/responses/responses.js +1 -0
  139. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/messages.js +1 -1
  140. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/runs.js +1 -1
  141. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/runs/steps.js +1 -1
  142. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/threads/threads.js +1 -1
  143. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/containers.js +1 -1
  144. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/containers/files/content.js +1 -0
  145. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/containers/files/files.js +1 -1
  146. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/files.js +1 -1
  147. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/calls.js +1 -1
  148. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/responses.js +1 -1
  149. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/content.js +1 -0
  150. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +1 -0
  151. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/file-batches.js +1 -1
  152. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/files.js +1 -1
  153. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/vector-stores/vector-stores.js +1 -1
  154. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/videos.js +1 -1
  155. package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/webhooks.js +1 -1
  156. package/dist/src/node_modules/.pnpm/openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/version.js +1 -0
  157. package/dist/src/public/ai/index.d.ts +1 -0
  158. package/dist/src/public/ai/index.js +1 -0
  159. package/dist/src/public/definitions/connections/mcp.d.ts +1 -0
  160. package/dist/src/public/definitions/connections/openapi.d.ts +1 -0
  161. package/dist/src/public/definitions/remote-agent.d.ts +5 -0
  162. package/dist/src/public/definitions/workspace-agent.d.ts +5 -0
  163. package/dist/src/public/definitions/workspace-agent.js +1 -1
  164. package/dist/src/public/instrumentation/otel.d.ts +1 -1
  165. package/dist/src/public/instrumentation/otel.js +1 -1
  166. package/dist/src/public/models/index.d.ts +1 -0
  167. package/dist/src/public/models/index.js +1 -0
  168. package/dist/src/public/models/openai/index.js +1 -1
  169. package/dist/src/public/tools/approval/index.d.ts +2 -1
  170. package/dist/src/public/tools/approval/index.js +1 -1
  171. package/dist/src/react/use-eve-agent.d.ts +11 -2
  172. package/dist/src/react/use-eve-agent.js +1 -1
  173. package/dist/src/runtime/agent/resolve-model.js +1 -1
  174. package/dist/src/runtime/connections/openapi-client.js +1 -1
  175. package/dist/src/runtime/resolve-agent-graph.js +1 -1
  176. package/dist/src/runtime/resolve-agent.js +1 -1
  177. package/dist/src/runtime/subagents/dynamic-agent-config.d.ts +1 -0
  178. package/dist/src/runtime/subagents/dynamic-agent-config.js +1 -1
  179. package/dist/src/runtime/subagents/dynamic-remote-agent-config.d.ts +1 -0
  180. package/dist/src/runtime/subagents/dynamic-remote-agent-config.js +1 -1
  181. package/dist/src/runtime/subagents/registry.d.ts +5 -2
  182. package/dist/src/runtime/subagents/registry.js +1 -1
  183. package/dist/src/runtime/types.d.ts +2 -0
  184. package/dist/src/setup/flows/model-login-connection.js +1 -1
  185. package/dist/src/setup/flows/model-login.js +1 -1
  186. package/dist/src/setup/primitives/pm/bun.d.ts +1 -1
  187. package/dist/src/setup/primitives/pm/bun.js +1 -1
  188. package/dist/src/setup/primitives/pm/npm.js +1 -1
  189. package/dist/src/setup/primitives/pm/pnpm.js +1 -1
  190. package/dist/src/setup/primitives/pm/run.d.ts +1 -1
  191. package/dist/src/setup/primitives/pm/run.js +1 -1
  192. package/dist/src/setup/primitives/pm/types.d.ts +4 -0
  193. package/dist/src/setup/scaffold/create/project.js +1 -1
  194. package/dist/src/setup/validate-gateway-key.js +1 -1
  195. package/dist/src/shared/agent-definition.d.ts +9 -0
  196. package/dist/src/tools/approval/policies.d.ts +18 -0
  197. package/dist/src/tools/approval/policies.js +1 -1
  198. package/dist/src/tools/definition.d.ts +4 -3
  199. package/dist/src/tools/durable-schema.js +1 -1
  200. package/dist/src/tools/schema.js +1 -1
  201. package/dist/src/tracing/agent-channel-delivery-instrumentation.d.ts +2 -3
  202. package/dist/src/tracing/agent-channel-delivery-instrumentation.js +1 -1
  203. package/dist/src/tracing/agent-otel-provider.js +2 -2
  204. package/dist/src/tracing/agent-otel-runtime-context.js +1 -1
  205. package/dist/src/tracing/agent-otel-session-context.js +1 -1
  206. package/dist/src/tracing/agent-trace-context-codec.js +1 -1
  207. package/dist/src/tracing/agent-trace-state.d.ts +1 -0
  208. package/dist/src/tracing/content-span-processor.d.ts +1 -1
  209. package/dist/src/tracing/content-span-processor.js +1 -1
  210. package/dist/src/tracing/local-instrumentation-runtime.js +1 -1
  211. package/dist/src/tracing/local-traces.d.ts +3 -8
  212. package/dist/src/tracing/local-traces.js +1 -1
  213. package/dist/src/tracing/otel-declaration.d.ts +7 -21
  214. package/dist/src/tracing/otel-declaration.js +1 -1
  215. package/dist/src/tracing/span-export-policy.d.ts +15 -20
  216. package/dist/src/tracing/span-export-policy.js +1 -1
  217. package/docs/agent-config.md +2 -1
  218. package/docs/connections/mcp.mdx +2 -2
  219. package/docs/connections/overview.mdx +1 -1
  220. package/docs/guides/evaluate.md +43 -19
  221. package/docs/guides/frontend/overview.mdx +44 -8
  222. package/docs/guides/instrumentation/otel.mdx +26 -22
  223. package/docs/guides/remote-agents.md +2 -1
  224. package/docs/reference/typescript-api.md +3 -2
  225. package/docs/subagents/index.mdx +25 -8
  226. package/docs/tools/human-in-the-loop.md +27 -5
  227. package/docs/tools/overview.mdx +4 -2
  228. package/docs/tools/workflows.mdx +2 -3
  229. package/package.json +11 -6
  230. package/dist/src/compiled/_chunks/node/undici-CI8l4LBf.js +0 -95
  231. package/dist/src/compiled/_chunks/workflow/coerce-ro2dOxbr.js +0 -1
  232. package/dist/src/compiled/_chunks/workflow/dist-C5KCXSdI.js +0 -2
  233. package/dist/src/compiled/_chunks/workflow/dist-DsNhwdzf.js +0 -1
  234. package/dist/src/compiled/_chunks/workflow/dist-KPieTJHT.js +0 -25
  235. package/dist/src/compiled/_chunks/workflow/sleep-BL0kgJnT.js +0 -1
  236. package/dist/src/experimental/evaluate/auto-model.js +0 -2
  237. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +0 -1
  238. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +0 -1
  239. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +0 -1
  240. package/dist/src/node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/dist/js-yaml.js +0 -32
  241. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +0 -1
  242. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/azure.js +0 -1
  243. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/client.js +0 -11
  244. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/core/uploads.js +0 -1
  245. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/index.js +0 -1
  246. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/headers.js +0 -1
  247. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/internal/uploads.js +0 -1
  248. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +0 -1
  249. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/AssistantStream.js +0 -1
  250. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +0 -1
  251. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +0 -1
  252. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/EventStream.js +0 -1
  253. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +0 -1
  254. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +0 -1
  255. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +0 -1
  256. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +0 -1
  257. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts.js +0 -1
  258. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +0 -1
  259. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +0 -1
  260. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/beta/beta.js +0 -1
  261. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/containers/files/content.js +0 -1
  262. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/content.js +0 -1
  263. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +0 -1
  264. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76/node_modules/openai/version.js +0 -1
  265. package/dist/src/public/experimental/evaluate/index.d.ts +0 -2
  266. package/dist/src/public/experimental/evaluate/index.js +0 -1
  267. /package/dist/src/{experimental/evaluate → ai}/evaluate.d.ts +0 -0
  268. /package/dist/src/{experimental/evaluate → ai}/evaluate.js +0 -0
  269. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/_vendor/partial-json-parser/parser.js +0 -0
  270. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/api-promise.js +0 -0
  271. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/error.js +0 -0
  272. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/pagination.js +0 -0
  273. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/core/resource.js +0 -0
  274. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/error.js +0 -0
  275. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/decoders/line.js +0 -0
  276. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/detect-platform.js +0 -0
  277. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/errors.js +0 -0
  278. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/parse.js +0 -0
  279. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/formats.js +0 -0
  280. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/stringify.js +0 -0
  281. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/qs/utils.js +0 -0
  282. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/request-options.js +0 -0
  283. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/shims.js +0 -0
  284. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/to-file.js +0 -0
  285. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/tslib.js +0 -0
  286. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/base64.js +0 -0
  287. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/bytes.js +0 -0
  288. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/env.js +0 -0
  289. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/path.js +0 -0
  290. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/query.js +0 -0
  291. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/sleep.js +0 -0
  292. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/uuid.js +0 -0
  293. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils/values.js +0 -0
  294. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/internal/utils.js +0 -0
  295. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/RunnableFunction.js +0 -0
  296. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/Util.js +0 -0
  297. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/chatCompletionUtils.js +0 -0
  298. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/lib/parser.js +0 -0
  299. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/admin.js +0 -0
  300. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/admin-api-keys.js +0 -0
  301. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/audit-logs.js +0 -0
  302. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/certificates.js +0 -0
  303. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/data-retention.js +0 -0
  304. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/groups.js +0 -0
  305. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/roles.js +0 -0
  306. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/groups/users.js +0 -0
  307. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/invites.js +0 -0
  308. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/api-keys.js +0 -0
  309. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/certificates.js +0 -0
  310. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/data-retention.js +0 -0
  311. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/groups.js +0 -0
  312. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/groups/roles.js +0 -0
  313. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +0 -0
  314. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/model-permissions.js +0 -0
  315. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/rate-limits.js +0 -0
  316. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/roles.js +0 -0
  317. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/roles.js +0 -0
  318. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/projects/users/users.js +0 -0
  319. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/roles.js +0 -0
  320. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/usage.js +0 -0
  321. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/roles.js +0 -0
  322. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/admin/organization/users/users.js +0 -0
  323. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/audio.js +0 -0
  324. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/transcriptions.js +0 -0
  325. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/audio/translations.js +0 -0
  326. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/batches.js +0 -0
  327. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/chatkit/chatkit.js +0 -0
  328. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/beta/realtime/realtime.js +0 -0
  329. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/chat.js +0 -0
  330. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/completions.js +0 -0
  331. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/index.js +0 -0
  332. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/completions/messages.js +0 -0
  333. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/chat/index.js +0 -0
  334. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/completions.js +0 -0
  335. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/conversations.js +0 -0
  336. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/conversations/items.js +0 -0
  337. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/embeddings.js +0 -0
  338. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/evals.js +0 -0
  339. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/output-items.js +0 -0
  340. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/evals/runs/runs.js +0 -0
  341. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/alpha.js +0 -0
  342. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/alpha/graders.js +0 -0
  343. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +0 -0
  344. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +0 -0
  345. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/fine-tuning.js +0 -0
  346. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +0 -0
  347. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/jobs/jobs.js +0 -0
  348. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/fine-tuning/methods.js +0 -0
  349. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/grader-models.js +0 -0
  350. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/graders/graders.js +0 -0
  351. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/images.js +0 -0
  352. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/index.js +0 -0
  353. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/models.js +0 -0
  354. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/moderations.js +0 -0
  355. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/client-secrets.js +0 -0
  356. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/realtime/realtime.js +0 -0
  357. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-items.js +0 -0
  358. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/responses/input-tokens.js +0 -0
  359. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/shared.js +0 -0
  360. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/skills.js +0 -0
  361. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/skills/versions/versions.js +0 -0
  362. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/parts.js +0 -0
  363. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/uploads/uploads.js +0 -0
  364. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks/index.js +0 -0
  365. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/resources/webhooks.js +0 -0
  366. /package/dist/src/node_modules/.pnpm/{openai@6.39.1_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76 → openai@6.49.0_@smithy_signature-v4@5.7.3_ws@8.21.3_bufferutil@4.1.0__zod@3.25.76}/node_modules/openai/streaming.js +0 -0
@@ -84,7 +84,7 @@ type SharedV4Headers = Record<string, string>;
84
84
  * A JSON value can be a string, number, boolean, object, array, or null.
85
85
  * JSON values can be serialized and deserialized by the JSON.stringify and JSON.parse methods.
86
86
  */
87
- type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
87
+ type JSONValue = null | string | number | boolean | Readonly<JSONObject> | readonly JSONValue[];
88
88
  type JSONObject = {
89
89
  [key: string]: JSONValue | undefined;
90
90
  };
@@ -332,1316 +332,1412 @@ type SharedV2ProviderMetadata = Record<string, Record<string, JSONValue>>;
332
332
  type SharedV2ProviderOptions = Record<string, Record<string, JSONValue>>;
333
333
 
334
334
  /**
335
- * Serializable error information for a batch or batch item.
336
- */
337
- type BatchV4Error = {
338
- readonly message: string;
339
- readonly type?: string;
340
- readonly code?: string;
341
- readonly statusCode?: number;
342
- };
343
- /**
344
- * Normalized lifecycle status for a batch.
345
- */
346
- type BatchV4Status = {
347
- readonly status: 'pending' | 'completed' | 'failed';
348
- readonly rawStatus?: string;
349
- readonly requestCounts?: {
350
- readonly total: number;
351
- readonly pending: number;
352
- readonly completed: number;
353
- readonly failed: number;
354
- };
355
- readonly error?: BatchV4Error;
356
- readonly createdAt?: string;
357
- readonly expiresAt?: string;
358
- readonly providerMetadata?: SharedV4ProviderMetadata;
359
- };
360
- /**
361
- * Options for starting a batch.
335
+ * A provider-specific content block that does not map to another standardized
336
+ * content part type.
362
337
  */
363
- type BatchV4StartOptions<REQUEST> = {
364
- readonly requests: ReadonlyArray<REQUEST>;
365
- readonly providerOptions?: SharedV4ProviderOptions;
366
- readonly abortSignal?: AbortSignal;
367
- readonly headers?: Record<string, string | undefined>;
338
+ type LanguageModelV4CustomContent = {
339
+ type: 'custom';
368
340
  /**
369
- * URL the provider notifies when the batch reaches a terminal state.
370
- * Providers that do not support completion webhooks should return an
371
- * unsupported warning.
341
+ * The kind of custom content, in the format `{provider}.{provider-type}`.
372
342
  */
373
- readonly webhookUrl?: string;
374
- };
375
- /**
376
- * Result of starting a batch.
377
- */
378
- type BatchV4StartResult = BatchV4Status & {
379
- readonly batchId: string;
380
- readonly warnings: Array<{
381
- readonly requestId?: string;
382
- readonly warning: SharedV4Warning;
383
- }>;
384
- };
385
- /**
386
- * Options for a batch status or results operation.
387
- */
388
- type BatchV4OperationOptions = {
389
- readonly batchId: string;
390
- readonly providerOptions?: SharedV4ProviderOptions;
391
- readonly abortSignal?: AbortSignal;
392
- readonly headers?: Record<string, string | undefined>;
393
- };
394
- /**
395
- * A complete terminal result for one request in a batch.
396
- */
397
- type BatchV4ItemResult<RESULT> = {
398
- readonly id: string;
399
- readonly status: 'succeeded';
400
- readonly result: RESULT;
401
- } | {
402
- readonly id: string;
403
- readonly status: 'failed';
404
- readonly error: BatchV4Error;
405
- readonly providerMetadata?: SharedV4ProviderMetadata;
406
- } | {
407
- readonly id: string;
408
- readonly status: 'cancelled' | 'expired';
409
- readonly error?: BatchV4Error;
410
- readonly providerMetadata?: SharedV4ProviderMetadata;
343
+ kind: `${string}.${string}`;
344
+ /**
345
+ * Additional provider-specific options. They are passed through
346
+ * to the provider from the AI SDK and enable provider-specific
347
+ * functionality that can be fully encapsulated in the provider.
348
+ */
349
+ providerMetadata?: SharedV4ProviderMetadata;
411
350
  };
351
+
412
352
  /**
413
- * Experimental structural capability for models that support durable batch
414
- * processing.
353
+ * A file that has been generated by the model.
354
+ * Generated files as base64 encoded strings or binary data.
355
+ * The files should be returned without any unnecessary conversion.
415
356
  */
416
- type BatchModelV4<REQUEST, RESULT> = {
417
- experimental_doStartBatch(options: BatchV4StartOptions<REQUEST>): PromiseLike<BatchV4StartResult>;
418
- experimental_doGetBatchStatus(options: BatchV4OperationOptions): PromiseLike<BatchV4Status>;
419
- experimental_doGetBatchResults(options: BatchV4OperationOptions): PromiseLike<ReadableStream<BatchV4ItemResult<RESULT>>>;
420
- };
421
-
422
- type EmbeddingModelV4CallOptions = {
423
- /**
424
- * List of text values to generate embeddings for.
425
- */
426
- values: Array<string>;
357
+ type LanguageModelV4File = {
358
+ type: 'file';
427
359
  /**
428
- * Abort signal for cancelling the operation.
360
+ * The IANA media type of the file, e.g. `image/png` or `audio/mp3`.
361
+ *
362
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
429
363
  */
430
- abortSignal?: AbortSignal;
364
+ mediaType: string;
431
365
  /**
432
- * Additional provider-specific options. They are passed through
433
- * to the provider from the AI SDK and enable provider-specific
434
- * functionality that can be fully encapsulated in the provider.
366
+ * Generated file data as a tagged discriminated union:
367
+ *
368
+ * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
369
+ * - `{ type: 'url', url }`: a URL that points to the file.
370
+ *
371
+ * The file data should be returned without any unnecessary conversion.
372
+ * If the API returns base64 encoded strings, the file data should be returned
373
+ * as base64 encoded strings. If the API returns binary data, the file data should
374
+ * be returned as binary data.
435
375
  */
436
- providerOptions?: SharedV4ProviderOptions;
376
+ data: SharedV4FileDataData | SharedV4FileDataUrl;
437
377
  /**
438
- * Additional HTTP headers to be sent with the request.
439
- * Only applicable for HTTP-based providers.
378
+ * Optional provider-specific metadata for the file part.
440
379
  */
441
- headers?: SharedV4Headers;
380
+ providerMetadata?: SharedV4ProviderMetadata;
442
381
  };
443
382
 
444
383
  /**
445
- * An embedding is a vector, i.e. an array of numbers.
446
- * It is e.g. used to represent a text as a vector of word embeddings.
384
+ * Reasoning that the model has generated.
447
385
  */
448
- type EmbeddingModelV4Embedding = Array<number>;
386
+ type LanguageModelV4Reasoning = {
387
+ type: 'reasoning';
388
+ text: string;
389
+ /**
390
+ * Optional provider-specific metadata for the reasoning part.
391
+ */
392
+ providerMetadata?: SharedV4ProviderMetadata;
393
+ };
449
394
 
450
395
  /**
451
- * The result of a embedding model doEmbed call.
396
+ * A file that has been generated by the model as part of reasoning.
397
+ * Generated files as base64 encoded strings or binary data.
398
+ * The files should be returned without any unnecessary conversion.
452
399
  */
453
- type EmbeddingModelV4Result = {
400
+ type LanguageModelV4ReasoningFile = {
401
+ type: 'reasoning-file';
454
402
  /**
455
- * Generated embeddings. They are in the same order as the input values.
403
+ * The IANA media type of the file, e.g. `image/png` or `audio/mp3`.
404
+ *
405
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
456
406
  */
457
- embeddings: Array<EmbeddingModelV4Embedding>;
407
+ mediaType: string;
458
408
  /**
459
- * Token usage. We only have input tokens for embeddings.
409
+ * Generated file data as a tagged discriminated union:
410
+ *
411
+ * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
412
+ * - `{ type: 'url', url }`: a URL that points to the file.
413
+ *
414
+ * The file data should be returned without any unnecessary conversion.
415
+ * If the API returns base64 encoded strings, the file data should be returned
416
+ * as base64 encoded strings. If the API returns binary data, the file data should
417
+ * be returned as binary data.
460
418
  */
461
- usage?: {
462
- tokens: number;
463
- };
419
+ data: SharedV4FileDataData | SharedV4FileDataUrl;
464
420
  /**
465
- * Additional provider-specific metadata. They are passed through
466
- * from the provider to the AI SDK and enable provider-specific
467
- * results that can be fully encapsulated in the provider.
421
+ * Optional provider-specific metadata for the reasoning file part.
468
422
  */
469
423
  providerMetadata?: SharedV4ProviderMetadata;
470
- /**
471
- * Optional response information for debugging purposes.
472
- */
473
- response?: {
474
- /**
475
- * Response headers.
476
- */
477
- headers?: SharedV4Headers;
478
- /**
479
- * The response body.
480
- */
481
- body?: unknown;
482
- };
483
- /**
484
- * Warnings for the call, e.g. unsupported settings.
485
- */
486
- warnings: Array<SharedV4Warning>;
487
424
  };
488
425
 
489
426
  /**
490
- * Specification for an embedding model that implements the embedding model
491
- * interface version 4.
492
- *
493
- * It is specific to text embeddings.
427
+ * A source that has been used as input to generate the response.
494
428
  */
495
- type EmbeddingModelV4 = {
429
+ type LanguageModelV4Source = {
430
+ type: 'source';
496
431
  /**
497
- * The embedding model must specify which embedding model interface
498
- * version it implements. This will allow us to evolve the embedding
499
- * model interface and retain backwards compatibility. The different
500
- * implementation versions can be handled as a discriminated union
501
- * on our side.
432
+ * The type of source - URL sources reference web content.
502
433
  */
503
- readonly specificationVersion: 'v4';
434
+ sourceType: 'url';
504
435
  /**
505
- * Name of the provider for logging purposes.
436
+ * The ID of the source.
506
437
  */
507
- readonly provider: string;
438
+ id: string;
508
439
  /**
509
- * Provider-specific model ID for logging purposes.
440
+ * The URL of the source.
510
441
  */
511
- readonly modelId: string;
442
+ url: string;
512
443
  /**
513
- * Limit of how many embeddings can be generated in a single API call.
514
- *
515
- * Use Infinity for models that do not have a limit.
444
+ * The title of the source.
516
445
  */
517
- readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
446
+ title?: string;
518
447
  /**
519
- * True if the model can handle multiple embedding calls in parallel.
448
+ * Additional provider metadata for the source.
520
449
  */
521
- readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
450
+ providerMetadata?: SharedV4ProviderMetadata;
451
+ } | {
452
+ type: 'source';
522
453
  /**
523
- * Generates a list of embeddings for the given input text.
524
- *
525
- * Naming: "do" prefix to prevent accidental direct usage of the method
526
- * by the user.
454
+ * The type of source - document sources reference files/documents.
527
455
  */
528
- doEmbed(options: EmbeddingModelV4CallOptions): PromiseLike<EmbeddingModelV4Result>;
529
- };
530
-
531
- type EmbeddingModelV3CallOptions = {
456
+ sourceType: 'document';
532
457
  /**
533
- * List of text values to generate embeddings for.
458
+ * The ID of the source.
534
459
  */
535
- values: Array<string>;
460
+ id: string;
536
461
  /**
537
- * Abort signal for cancelling the operation.
462
+ * IANA media type of the document (e.g., 'application/pdf').
538
463
  */
539
- abortSignal?: AbortSignal;
464
+ mediaType: string;
540
465
  /**
541
- * Additional provider-specific options. They are passed through
542
- * to the provider from the AI SDK and enable provider-specific
543
- * functionality that can be fully encapsulated in the provider.
466
+ * The title of the document.
544
467
  */
545
- providerOptions?: SharedV3ProviderOptions;
468
+ title: string;
546
469
  /**
547
- * Additional HTTP headers to be sent with the request.
548
- * Only applicable for HTTP-based providers.
470
+ * Optional filename of the document.
549
471
  */
550
- headers?: SharedV3Headers;
472
+ filename?: string;
473
+ /**
474
+ * Additional provider metadata for the source.
475
+ */
476
+ providerMetadata?: SharedV4ProviderMetadata;
551
477
  };
552
478
 
553
479
  /**
554
- * An embedding is a vector, i.e. an array of numbers.
555
- * It is e.g. used to represent a text as a vector of word embeddings.
556
- */
557
- type EmbeddingModelV3Embedding = Array<number>;
558
-
559
- /**
560
- * The result of a embedding model doEmbed call.
480
+ * Text that the model has generated.
561
481
  */
562
- type EmbeddingModelV3Result = {
482
+ type LanguageModelV4Text = {
483
+ type: 'text';
563
484
  /**
564
- * Generated embeddings. They are in the same order as the input values.
485
+ * The text content.
565
486
  */
566
- embeddings: Array<EmbeddingModelV3Embedding>;
487
+ text: string;
488
+ providerMetadata?: SharedV4ProviderMetadata;
489
+ };
490
+
491
+ /**
492
+ * Tool approval request emitted by a provider for a provider-executed tool call.
493
+ *
494
+ * This is used for flows where the provider executes the tool (e.g. MCP tools)
495
+ * but requires an explicit user approval before continuing.
496
+ */
497
+ type LanguageModelV4ToolApprovalRequest = {
498
+ type: 'tool-approval-request';
567
499
  /**
568
- * Token usage. We only have input tokens for embeddings.
500
+ * ID of the approval request. This ID is referenced by the subsequent
501
+ * tool-approval-response (tool message) to approve or deny execution.
569
502
  */
570
- usage?: {
571
- tokens: number;
572
- };
503
+ approvalId: string;
573
504
  /**
574
- * Additional provider-specific metadata. They are passed through
575
- * from the provider to the AI SDK and enable provider-specific
576
- * results that can be fully encapsulated in the provider.
505
+ * The tool call ID that this approval request is for.
577
506
  */
578
- providerMetadata?: SharedV3ProviderMetadata;
507
+ toolCallId: string;
579
508
  /**
580
- * Optional response information for debugging purposes.
509
+ * Additional provider-specific metadata for the approval request.
581
510
  */
582
- response?: {
583
- /**
584
- * Response headers.
585
- */
586
- headers?: SharedV3Headers;
587
- /**
588
- * The response body.
589
- */
590
- body?: unknown;
591
- };
511
+ providerMetadata?: SharedV4ProviderMetadata;
512
+ };
513
+
514
+ /**
515
+ * Tool calls that the model has generated.
516
+ */
517
+ type LanguageModelV4ToolCall = {
518
+ type: 'tool-call';
592
519
  /**
593
- * Warnings for the call, e.g. unsupported settings.
520
+ * The identifier of the tool call. It must be unique across all tool calls.
594
521
  */
595
- warnings: Array<SharedV3Warning>;
522
+ toolCallId: string;
523
+ /**
524
+ * The name of the tool that should be called.
525
+ */
526
+ toolName: string;
527
+ /**
528
+ * Stringified JSON object with the tool call arguments. Must match the
529
+ * parameters schema of the tool.
530
+ */
531
+ input: string;
532
+ /**
533
+ * Whether the tool call will be executed by the provider.
534
+ * If this flag is not set or is false, the tool call will be executed by the client.
535
+ */
536
+ providerExecuted?: boolean;
537
+ /**
538
+ * Whether the tool is dynamic, i.e. defined at runtime.
539
+ * For example, MCP (Model Context Protocol) tools that are executed by the provider.
540
+ */
541
+ dynamic?: boolean;
542
+ /**
543
+ * Additional provider-specific metadata for the tool call.
544
+ */
545
+ providerMetadata?: SharedV4ProviderMetadata;
596
546
  };
597
547
 
548
+ declare function isJSONValue(value: unknown): value is JSONValue;
549
+ declare function isJSONArray(value: unknown): value is JSONArray;
550
+ declare function isJSONObject(value: unknown): value is JSONObject;
551
+
598
552
  /**
599
- * Specification for an embedding model that implements the embedding model
600
- * interface version 3.
601
- *
602
- * It is specific to text embeddings.
553
+ * Result of a tool call that has been executed by the provider.
603
554
  */
604
- type EmbeddingModelV3 = {
555
+ type LanguageModelV4ToolResult = {
556
+ type: 'tool-result';
605
557
  /**
606
- * The embedding model must specify which embedding model interface
607
- * version it implements. This will allow us to evolve the embedding
608
- * model interface and retain backwards compatibility. The different
609
- * implementation versions can be handled as a discriminated union
610
- * on our side.
558
+ * The ID of the tool call that this result is associated with.
611
559
  */
612
- readonly specificationVersion: 'v3';
560
+ toolCallId: string;
613
561
  /**
614
- * Name of the provider for logging purposes.
562
+ * Name of the tool that generated this result.
615
563
  */
616
- readonly provider: string;
564
+ toolName: string;
617
565
  /**
618
- * Provider-specific model ID for logging purposes.
566
+ * Result of the tool call. This is a JSON-serializable object.
619
567
  */
620
- readonly modelId: string;
568
+ result: NonNullable<JSONValue>;
621
569
  /**
622
- * Limit of how many embeddings can be generated in a single API call.
570
+ * Optional flag if the result is an error or an error message.
571
+ */
572
+ isError?: boolean;
573
+ /**
574
+ * Whether the tool result is preliminary.
623
575
  *
624
- * Use Infinity for models that do not have a limit.
576
+ * Preliminary tool results replace each other, e.g. image previews.
577
+ * There always has to be a final, non-preliminary tool result.
578
+ *
579
+ * If this flag is set to true, the tool result is preliminary.
580
+ * If this flag is not set or is false, the tool result is not preliminary.
625
581
  */
626
- readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
582
+ preliminary?: boolean;
627
583
  /**
628
- * True if the model can handle multiple embedding calls in parallel.
584
+ * Whether the tool is dynamic, i.e. defined at runtime.
585
+ * For example, MCP (Model Context Protocol) tools that are executed by the provider.
629
586
  */
630
- readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
587
+ dynamic?: boolean;
631
588
  /**
632
- * Generates a list of embeddings for the given input text.
633
- *
634
- * Naming: "do" prefix to prevent accidental direct usage of the method
635
- * by the user.
589
+ * Additional provider-specific metadata for the tool result.
636
590
  */
637
- doEmbed(options: EmbeddingModelV3CallOptions): PromiseLike<EmbeddingModelV3Result>;
591
+ providerMetadata?: SharedV4ProviderMetadata;
638
592
  };
639
593
 
640
- /**
641
- * An embedding is a vector, i.e. an array of numbers.
642
- * It is e.g. used to represent a text as a vector of word embeddings.
643
- */
644
- type EmbeddingModelV2Embedding = Array<number>;
594
+ type LanguageModelV4Content = LanguageModelV4Text | LanguageModelV4Reasoning | LanguageModelV4CustomContent | LanguageModelV4ReasoningFile | LanguageModelV4File | LanguageModelV4ToolApprovalRequest | LanguageModelV4Source | LanguageModelV4ToolCall | LanguageModelV4ToolResult;
645
595
 
646
596
  /**
647
- * Specification for an embedding model that implements the embedding model
648
- * interface version 2.
597
+ * Reason why a language model finished generating a response.
649
598
  *
650
- * VALUE is the type of the values that the model can embed.
651
- * This will allow us to go beyond text embeddings in the future,
652
- * e.g. to support image embeddings
599
+ * Contains both a unified finish reason and a raw finish reason from the provider.
600
+ * The unified finish reason is used to provide a consistent finish reason across different providers.
601
+ * The raw finish reason is used to provide the original finish reason from the provider.
653
602
  */
654
- type EmbeddingModelV2<VALUE> = {
603
+ type LanguageModelV4FinishReason = {
655
604
  /**
656
- * The embedding model must specify which embedding model interface
657
- * version it implements. This will allow us to evolve the embedding
658
- * model interface and retain backwards compatibility. The different
659
- * implementation versions can be handled as a discriminated union
660
- * on our side.
605
+ * Unified finish reason. This enables using the same finish reason across different providers.
606
+ *
607
+ * Can be one of the following:
608
+ * - `stop`: model generated stop sequence
609
+ * - `length`: model generated maximum number of tokens
610
+ * - `content-filter`: content filter violation stopped the model
611
+ * - `tool-calls`: model triggered tool calls
612
+ * - `error`: model stopped because of an error
613
+ * - `other`: model stopped for other reasons
661
614
  */
662
- readonly specificationVersion: 'v2';
615
+ unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
663
616
  /**
664
- * Name of the provider for logging purposes.
617
+ * Raw finish reason from the provider.
618
+ * This is the original finish reason from the provider.
665
619
  */
666
- readonly provider: string;
620
+ raw: string | undefined;
621
+ };
622
+
623
+ interface LanguageModelV4ResponseMetadata {
667
624
  /**
668
- * Provider-specific model ID for logging purposes.
625
+ * ID for the generated response, if the provider sends one.
669
626
  */
670
- readonly modelId: string;
627
+ id?: string;
671
628
  /**
672
- * Limit of how many embeddings can be generated in a single API call.
673
- *
674
- * Use Infinity for models that do not have a limit.
629
+ * Timestamp for the start of the generated response, if the provider sends one.
675
630
  */
676
- readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
631
+ timestamp?: Date;
677
632
  /**
678
- * True if the model can handle multiple embedding calls in parallel.
633
+ * The ID of the response model that was used to generate the response, if the provider sends one.
679
634
  */
680
- readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
635
+ modelId?: string;
636
+ }
637
+
638
+ /**
639
+ * Usage information for a language model call.
640
+ */
641
+ type LanguageModelV4Usage = {
681
642
  /**
682
- * Generates a list of embeddings for the given input text.
683
- *
684
- * Naming: "do" prefix to prevent accidental direct usage of the method
685
- * by the user.
643
+ * Information about the input tokens.
686
644
  */
687
- doEmbed(options: {
688
- /**
689
- * List of values to embed.
690
- */
691
- values: Array<VALUE>;
645
+ inputTokens: {
692
646
  /**
693
- * Abort signal for cancelling the operation.
647
+ * The total number of input (prompt) tokens used.
694
648
  */
695
- abortSignal?: AbortSignal;
649
+ total: number | undefined;
696
650
  /**
697
- * Additional provider-specific options. They are passed through
698
- * to the provider from the AI SDK and enable provider-specific
699
- * functionality that can be fully encapsulated in the provider.
651
+ * The number of non-cached input (prompt) tokens used.
700
652
  */
701
- providerOptions?: SharedV2ProviderOptions;
653
+ noCache: number | undefined;
702
654
  /**
703
- * Additional HTTP headers to be sent with the request.
704
- * Only applicable for HTTP-based providers.
655
+ * The number of cached input (prompt) tokens read.
705
656
  */
706
- headers?: Record<string, string | undefined>;
707
- }): PromiseLike<{
657
+ cacheRead: number | undefined;
708
658
  /**
709
- * Generated embeddings. They are in the same order as the input values.
659
+ * The number of cached input (prompt) tokens written.
710
660
  */
711
- embeddings: Array<EmbeddingModelV2Embedding>;
661
+ cacheWrite: number | undefined;
662
+ };
663
+ /**
664
+ * Information about the output tokens.
665
+ */
666
+ outputTokens: {
712
667
  /**
713
- * Token usage. We only have input tokens for embeddings.
668
+ * The total number of output (completion) tokens used.
714
669
  */
715
- usage?: {
716
- tokens: number;
717
- };
670
+ total: number | undefined;
718
671
  /**
719
- * Additional provider-specific metadata. They are passed through
720
- * from the provider to the AI SDK and enable provider-specific
721
- * results that can be fully encapsulated in the provider.
672
+ * The number of text tokens used.
722
673
  */
723
- providerMetadata?: SharedV2ProviderMetadata;
674
+ text: number | undefined;
724
675
  /**
725
- * Optional response information for debugging purposes.
676
+ * The number of reasoning tokens used.
726
677
  */
727
- response?: {
728
- /**
729
- * Response headers.
730
- */
731
- headers?: SharedV2Headers;
732
- /**
733
- * The response body.
734
- */
735
- body?: unknown;
736
- };
737
- }>;
738
- };
739
-
740
- declare const symbol$e: unique symbol;
678
+ reasoning: number | undefined;
679
+ };
680
+ /**
681
+ * Raw usage information from the provider.
682
+ *
683
+ * This is the usage information in the shape that the provider returns.
684
+ * It can include additional information that is not part of the standard usage information.
685
+ */
686
+ raw?: JSONObject;
687
+ };
688
+
741
689
  /**
742
- * Custom error class for AI SDK related errors.
743
- * @extends Error
690
+ * The result of a language model doGenerate call.
744
691
  */
745
- declare class AISDKError extends Error {
746
- private readonly [symbol$e];
692
+ type LanguageModelV4GenerateResult = {
747
693
  /**
748
- * The underlying cause of the error, if any.
694
+ * Ordered content that the model has generated.
749
695
  */
750
- readonly cause?: unknown;
696
+ content: Array<LanguageModelV4Content>;
751
697
  /**
752
- * Creates an AI SDK Error.
753
- *
754
- * @param {Object} params - The parameters for creating the error.
755
- * @param {string} params.name - The name of the error.
756
- * @param {string} params.message - The error message.
757
- * @param {unknown} [params.cause] - The underlying cause of the error.
698
+ * The finish reason.
758
699
  */
759
- constructor({ name, message, cause, }: {
760
- name: string;
761
- message: string;
762
- cause?: unknown;
763
- });
700
+ finishReason: LanguageModelV4FinishReason;
764
701
  /**
765
- * Checks if the given error is an AI SDK Error.
766
- * @param {unknown} error - The error to check.
767
- * @returns {boolean} True if the error is an AI SDK Error, false otherwise.
702
+ * The usage information.
768
703
  */
769
- static isInstance(error: unknown): error is AISDKError;
770
- protected static hasMarker(error: unknown, marker: string): boolean;
771
- }
772
-
773
- declare const symbol$d: unique symbol;
774
- declare class APICallError extends AISDKError {
775
- private readonly [symbol$d];
776
- readonly url: string;
777
- readonly requestBodyValues: unknown;
778
- readonly statusCode?: number;
779
- readonly responseHeaders?: Record<string, string>;
780
- readonly responseBody?: string;
781
- readonly isRetryable: boolean;
782
- readonly data?: unknown;
783
- constructor({ message, url, requestBodyValues, statusCode, responseHeaders, responseBody, cause, isRetryable, // server error
784
- data, }: {
785
- message: string;
786
- url: string;
787
- requestBodyValues: unknown;
788
- statusCode?: number;
789
- responseHeaders?: Record<string, string>;
790
- responseBody?: string;
791
- cause?: unknown;
792
- isRetryable?: boolean;
793
- data?: unknown;
794
- });
795
- static isInstance(error: unknown): error is APICallError;
796
- }
797
-
798
- declare const symbol$c: unique symbol;
799
- declare class EmptyResponseBodyError extends AISDKError {
800
- private readonly [symbol$c];
801
- constructor({ message }?: {
802
- message?: string;
803
- });
804
- static isInstance(error: unknown): error is EmptyResponseBodyError;
805
- }
806
-
807
- declare function getErrorMessage(error: unknown | undefined): string;
808
-
809
- declare const symbol$b: unique symbol;
810
- /**
811
- * A function argument is invalid.
812
- */
813
- declare class InvalidArgumentError extends AISDKError {
814
- private readonly [symbol$b];
815
- readonly argument: string;
816
- constructor({ message, cause, argument, }: {
817
- argument: string;
818
- message: string;
819
- cause?: unknown;
820
- });
821
- static isInstance(error: unknown): error is InvalidArgumentError;
822
- }
823
-
824
- declare const symbol$a: unique symbol;
825
- /**
826
- * A prompt is invalid. This error should be thrown by providers when they cannot
827
- * process a prompt.
828
- */
829
- declare class InvalidPromptError extends AISDKError {
830
- private readonly [symbol$a];
831
- readonly prompt: unknown;
832
- constructor({ prompt, message, cause, }: {
833
- prompt: unknown;
834
- message: string;
835
- cause?: unknown;
836
- });
837
- static isInstance(error: unknown): error is InvalidPromptError;
838
- }
704
+ usage: LanguageModelV4Usage;
705
+ /**
706
+ * Additional provider-specific metadata. They are passed through
707
+ * from the provider to the AI SDK and enable provider-specific
708
+ * results that can be fully encapsulated in the provider.
709
+ */
710
+ providerMetadata?: SharedV4ProviderMetadata;
711
+ /**
712
+ * Optional request information for telemetry and debugging purposes.
713
+ */
714
+ request?: {
715
+ /**
716
+ * Request HTTP body that was sent to the provider API.
717
+ */
718
+ body?: unknown;
719
+ };
720
+ /**
721
+ * Optional response information for telemetry and debugging purposes.
722
+ */
723
+ response?: LanguageModelV4ResponseMetadata & {
724
+ /**
725
+ * Response headers.
726
+ */
727
+ headers?: SharedV4Headers;
728
+ /**
729
+ * Response HTTP body.
730
+ */
731
+ body?: unknown;
732
+ };
733
+ /**
734
+ * Warnings for the call, e.g. unsupported settings.
735
+ */
736
+ warnings: Array<SharedV4Warning>;
737
+ };
839
738
 
840
- declare const symbol$9: unique symbol;
841
739
  /**
842
- * Server returned a response with invalid data content.
843
- * This should be thrown by providers when they cannot parse the response from the API.
740
+ * An image file that can be used for image editing or variation generation.
844
741
  */
845
- declare class InvalidResponseDataError extends AISDKError {
846
- private readonly [symbol$9];
847
- readonly data: unknown;
848
- constructor({ data, message, }: {
849
- data: unknown;
850
- message?: string;
851
- });
852
- static isInstance(error: unknown): error is InvalidResponseDataError;
853
- }
854
-
855
- declare const symbol$8: unique symbol;
856
- declare class JSONParseError extends AISDKError {
857
- private readonly [symbol$8];
858
- readonly text: string;
859
- constructor({ text, cause }: {
860
- text: string;
861
- cause: unknown;
862
- });
863
- static isInstance(error: unknown): error is JSONParseError;
864
- }
865
-
866
- declare const symbol$7: unique symbol;
867
- declare class LoadAPIKeyError extends AISDKError {
868
- private readonly [symbol$7];
869
- constructor({ message }: {
870
- message: string;
871
- });
872
- static isInstance(error: unknown): error is LoadAPIKeyError;
873
- }
742
+ type ImageModelV4File = {
743
+ type: 'file';
744
+ /**
745
+ * The IANA media type of the file, e.g. `image/png`. Any string is supported.
746
+ *
747
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
748
+ */
749
+ mediaType: string;
750
+ /**
751
+ * Generated file data as base64 encoded strings or binary data.
752
+ *
753
+ * The file data should be returned without any unnecessary conversion.
754
+ * If the API returns base64 encoded strings, the file data should be returned
755
+ * as base64 encoded strings. If the API returns binary data, the file data should
756
+ * be returned as binary data.
757
+ */
758
+ data: string | Uint8Array;
759
+ /**
760
+ * Optional provider-specific metadata for the file part.
761
+ */
762
+ providerOptions?: SharedV4ProviderMetadata;
763
+ } | {
764
+ type: 'url';
765
+ /**
766
+ * The URL of the image file.
767
+ */
768
+ url: string;
769
+ /**
770
+ * Optional provider-specific metadata for the file part.
771
+ */
772
+ providerOptions?: SharedV4ProviderMetadata;
773
+ };
874
774
 
875
- declare const symbol$6: unique symbol;
876
- declare class LoadSettingError extends AISDKError {
877
- private readonly [symbol$6];
878
- constructor({ message }: {
879
- message: string;
880
- });
881
- static isInstance(error: unknown): error is LoadSettingError;
882
- }
775
+ type ImageModelV4CallOptions = {
776
+ /**
777
+ * Prompt for the image generation. Some operations, like upscaling, may not require a prompt.
778
+ */
779
+ prompt: string | undefined;
780
+ /**
781
+ * Number of images to generate.
782
+ */
783
+ n: number;
784
+ /**
785
+ * Size of the images to generate.
786
+ * Must have the format `{width}x{height}`.
787
+ * `undefined` will use the provider's default size.
788
+ */
789
+ size: `${number}x${number}` | undefined;
790
+ /**
791
+ * Aspect ratio of the images to generate.
792
+ * Must have the format `{width}:{height}`.
793
+ * `undefined` will use the provider's default aspect ratio.
794
+ */
795
+ aspectRatio: `${number}:${number}` | undefined;
796
+ /**
797
+ * Seed for the image generation.
798
+ * `undefined` will use the provider's default seed.
799
+ */
800
+ seed: number | undefined;
801
+ /**
802
+ * Array of images for image editing or variation generation.
803
+ * The images should be provided as base64 encoded strings or binary data.
804
+ */
805
+ files: ImageModelV4File[] | undefined;
806
+ /**
807
+ * Mask image for inpainting operations.
808
+ * The mask should be provided as base64 encoded strings or binary data.
809
+ */
810
+ mask: ImageModelV4File | undefined;
811
+ /**
812
+ * Additional provider-specific options that are passed through to the provider
813
+ * as body parameters.
814
+ *
815
+ * The outer record is keyed by the provider name, and the inner
816
+ * record is keyed by the provider-specific metadata key.
817
+ *
818
+ * ```ts
819
+ * {
820
+ * "openai": {
821
+ * "style": "vivid"
822
+ * }
823
+ * }
824
+ * ```
825
+ */
826
+ providerOptions: SharedV4ProviderOptions;
827
+ /**
828
+ * Abort signal for cancelling the operation.
829
+ */
830
+ abortSignal?: AbortSignal;
831
+ /**
832
+ * Additional HTTP headers to be sent with the request.
833
+ * Only applicable for HTTP-based providers.
834
+ */
835
+ headers?: Record<string, string | undefined>;
836
+ };
883
837
 
884
- declare const symbol$5: unique symbol;
885
838
  /**
886
- * Thrown when the AI provider fails to generate any content.
839
+ * Usage information for an image model call.
887
840
  */
888
- declare class NoContentGeneratedError extends AISDKError {
889
- private readonly [symbol$5];
890
- constructor({ message, }?: {
891
- message?: string;
892
- });
893
- static isInstance(error: unknown): error is NoContentGeneratedError;
894
- }
841
+ type ImageModelV4Usage = {
842
+ /**
843
+ * The number of input (prompt) tokens used.
844
+ */
845
+ inputTokens: number | undefined;
846
+ /**
847
+ * The number of output tokens used, if reported by the provider.
848
+ */
849
+ outputTokens: number | undefined;
850
+ /**
851
+ * The total number of tokens as reported by the provider.
852
+ */
853
+ totalTokens: number | undefined;
854
+ };
895
855
 
896
- declare const symbol$4: unique symbol;
897
- declare class NoSuchModelError extends AISDKError {
898
- private readonly [symbol$4];
899
- readonly modelId: string;
900
- readonly modelType: 'languageModel' | 'embeddingModel' | 'imageModel' | 'transcriptionModel' | 'speechModel' | 'rerankingModel' | 'videoModel';
901
- constructor({ errorName, modelId, modelType, message, }: {
902
- errorName?: string;
856
+ type ImageModelV4ProviderMetadata = Record<string, {
857
+ images: JSONArray;
858
+ } & JSONValue>;
859
+ /**
860
+ * The result of an image model doGenerate call.
861
+ */
862
+ type ImageModelV4Result = {
863
+ /**
864
+ * Generated images as base64 encoded strings or binary data.
865
+ * The images should be returned without any unnecessary conversion.
866
+ * If the API returns base64 encoded strings, the images should be returned
867
+ * as base64 encoded strings. If the API returns binary data, the images should
868
+ * be returned as binary data.
869
+ */
870
+ images: Array<string> | Array<Uint8Array>;
871
+ /**
872
+ * Whether an unsuccessful result, such as an empty image result, can be
873
+ * retried. When omitted, the result is unclassified.
874
+ */
875
+ isRetryable?: boolean;
876
+ /**
877
+ * Warnings for the call, e.g. unsupported features.
878
+ */
879
+ warnings: Array<SharedV4Warning>;
880
+ /**
881
+ * Additional provider-specific metadata. They are passed through
882
+ * from the provider to the AI SDK and enable provider-specific
883
+ * results that can be fully encapsulated in the provider.
884
+ *
885
+ * The outer record is keyed by the provider name, and the inner
886
+ * record is provider-specific metadata. It always includes an
887
+ * `images` key with image-specific metadata
888
+ *
889
+ * ```ts
890
+ * {
891
+ * "openai": {
892
+ * "images": ["revisedPrompt": "Revised prompt here."]
893
+ * }
894
+ * }
895
+ * ```
896
+ */
897
+ providerMetadata?: ImageModelV4ProviderMetadata;
898
+ /**
899
+ * Response information for telemetry and debugging purposes.
900
+ */
901
+ response: {
902
+ /**
903
+ * Timestamp for the start of the generated response.
904
+ */
905
+ timestamp: Date;
906
+ /**
907
+ * The ID of the response model that was used to generate the response.
908
+ */
903
909
  modelId: string;
904
- modelType: 'languageModel' | 'embeddingModel' | 'imageModel' | 'transcriptionModel' | 'speechModel' | 'rerankingModel' | 'videoModel';
905
- message?: string;
906
- });
907
- static isInstance(error: unknown): error is NoSuchModelError;
908
- }
910
+ /**
911
+ * Response headers.
912
+ */
913
+ headers: Record<string, string> | undefined;
914
+ };
915
+ /**
916
+ * Optional token usage for the image generation call (if the provider reports it).
917
+ */
918
+ usage?: ImageModelV4Usage;
919
+ };
909
920
 
910
- declare const symbol$3: unique symbol;
921
+ type GetMaxImagesPerCallFunction$2 = (options: {
922
+ modelId: string;
923
+ }) => PromiseLike<number | undefined> | number | undefined;
911
924
  /**
912
- * Thrown when a provider reference cannot be resolved because the specified
913
- * provider is not found in the provider reference mapping.
925
+ * Image generation model specification version 4.
914
926
  */
915
- declare class NoSuchProviderReferenceError extends AISDKError {
916
- private readonly [symbol$3];
917
- readonly provider: string;
918
- readonly reference: SharedV4ProviderReference;
919
- constructor({ provider, reference, message, }: {
920
- provider: string;
921
- reference: SharedV4ProviderReference;
922
- message?: string;
923
- });
924
- static isInstance(error: unknown): error is NoSuchProviderReferenceError;
925
- }
926
-
927
- declare const symbol$2: unique symbol;
928
- declare class TooManyEmbeddingValuesForCallError extends AISDKError {
929
- private readonly [symbol$2];
927
+ type ImageModelV4 = {
928
+ /**
929
+ * The image model must specify which image model interface
930
+ * version it implements. This will allow us to evolve the image
931
+ * model interface and retain backwards compatibility. The different
932
+ * implementation versions can be handled as a discriminated union
933
+ * on our side.
934
+ */
935
+ readonly specificationVersion: 'v4';
936
+ /**
937
+ * Name of the provider for logging purposes.
938
+ */
930
939
  readonly provider: string;
940
+ /**
941
+ * Provider-specific model ID for logging purposes.
942
+ */
931
943
  readonly modelId: string;
932
- readonly maxEmbeddingsPerCall: number;
933
- readonly values: Array<unknown>;
934
- constructor(options: {
935
- provider: string;
936
- modelId: string;
937
- maxEmbeddingsPerCall: number;
938
- values: Array<unknown>;
939
- });
940
- static isInstance(error: unknown): error is TooManyEmbeddingValuesForCallError;
941
- }
942
-
943
- declare const symbol$1: unique symbol;
944
- interface TypeValidationContext {
945
944
  /**
946
- * Field path in dot notation (e.g., "message.metadata", "message.parts[3].data")
945
+ * Limit of how many images can be generated in a single API call.
946
+ * Can be set to a number for a fixed limit, to undefined to use
947
+ * the global limit, or a function that returns a number or undefined,
948
+ * optionally as a promise.
947
949
  */
948
- field?: string;
950
+ readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction$2;
949
951
  /**
950
- * Entity name (e.g., tool name, data type name)
952
+ * Generates an array of images.
951
953
  */
952
- entityName?: string;
954
+ doGenerate(options: ImageModelV4CallOptions): PromiseLike<ImageModelV4Result>;
955
+ };
956
+
957
+ /**
958
+ * Fields shared by every request in a batch.
959
+ */
960
+ type BatchV4RequestBase<ModelId extends string = string> = {
953
961
  /**
954
- * Entity identifier (e.g., message ID, tool call ID)
962
+ * Application-provided identifier used to correlate the request with its
963
+ * result.
955
964
  */
956
- entityId?: string;
957
- }
958
- declare class TypeValidationError extends AISDKError {
959
- private readonly [symbol$1];
960
- readonly value: unknown;
961
- readonly context?: TypeValidationContext;
962
- constructor({ value, cause, context, }: {
963
- value: unknown;
964
- cause: unknown;
965
- context?: TypeValidationContext;
966
- });
967
- static isInstance(error: unknown): error is TypeValidationError;
965
+ readonly id: string;
968
966
  /**
969
- * Wraps an error into a TypeValidationError.
970
- * If the cause is already a TypeValidationError with the same value and context, it returns the cause.
971
- * Otherwise, it creates a new TypeValidationError.
972
- *
973
- * @param {Object} params - The parameters for wrapping the error.
974
- * @param {unknown} params.value - The value that failed validation.
975
- * @param {unknown} params.cause - The original error or cause of the validation failure.
976
- * @param {TypeValidationContext} params.context - Optional context about what is being validated.
977
- * @returns {TypeValidationError} A TypeValidationError instance.
967
+ * Provider-specific model ID for this request.
978
968
  */
979
- static wrap({ value, cause, context, }: {
980
- value: unknown;
981
- cause: unknown;
982
- context?: TypeValidationContext;
983
- }): TypeValidationError;
984
- }
969
+ readonly modelId: ModelId;
970
+ };
985
971
 
986
- declare const symbol: unique symbol;
987
- declare class UnsupportedFunctionalityError extends AISDKError {
988
- private readonly [symbol];
989
- readonly functionality: string;
990
- constructor({ functionality, message, }: {
991
- functionality: string;
992
- message?: string;
993
- });
994
- static isInstance(error: unknown): error is UnsupportedFunctionalityError;
995
- }
972
+ /**
973
+ * One image generation request in a batch.
974
+ */
975
+ type ImageBatchV4Request<ModelId extends string = string> = BatchV4RequestBase<ModelId> & {
976
+ readonly type: 'image';
977
+ readonly options: Pick<ImageModelV4CallOptions, 'prompt' | 'n' | 'size' | 'aspectRatio' | 'seed' | 'files' | 'mask' | 'providerOptions'>;
978
+ };
996
979
 
997
980
  /**
998
- * Options for deleting a file via the files interface.
981
+ * A tool has a name, a description, and a set of parameters.
982
+ *
983
+ * Note: this is **not** the user-facing tool definition. The AI SDK methods will
984
+ * map the user-facing tool definitions to this format.
999
985
  */
1000
- type FilesV4DeleteFileCallOptions = {
986
+ type LanguageModelV4FunctionTool = {
1001
987
  /**
1002
- * The provider reference of the file, as returned by `uploadFile`.
988
+ * The type of the tool (always 'function').
1003
989
  */
1004
- file: SharedV4ProviderReference;
990
+ type: 'function';
1005
991
  /**
1006
- * Abort signal for cancelling the operation.
992
+ * The name of the tool. Unique within this model call.
1007
993
  */
1008
- abortSignal?: AbortSignal;
994
+ name: string;
1009
995
  /**
1010
- * Additional HTTP headers to be sent with the request.
1011
- * Only applicable for HTTP-based providers.
996
+ * A description of the tool. The language model uses this to understand the
997
+ * tool's purpose and to provide better completion suggestions.
1012
998
  */
1013
- headers?: Record<string, string | undefined>;
999
+ description?: string;
1014
1000
  /**
1015
- * Additional provider-specific options. They are passed through
1016
- * to the provider from the AI SDK and enable provider-specific
1017
- * functionality that can be fully encapsulated in the provider.
1001
+ * The parameters that the tool expects. The language model uses this to
1002
+ * understand the tool's input requirements and to provide matching suggestions.
1003
+ */
1004
+ inputSchema: JSONSchema7;
1005
+ /**
1006
+ * An optional list of input examples that show the language
1007
+ * model what the input should look like.
1008
+ */
1009
+ inputExamples?: Array<{
1010
+ input: JSONObject;
1011
+ }>;
1012
+ /**
1013
+ * Strict mode setting for the tool.
1014
+ *
1015
+ * Providers that support strict mode will use this setting to determine
1016
+ * how the input should be generated. Strict mode will always produce
1017
+ * valid inputs, but it might limit what input schemas are supported.
1018
+ */
1019
+ strict?: boolean;
1020
+ /**
1021
+ * The provider-specific options for the tool.
1018
1022
  */
1019
1023
  providerOptions?: SharedV4ProviderOptions;
1020
1024
  };
1021
1025
 
1022
1026
  /**
1023
- * Result of deleting a file via the files interface.
1027
+ * A prompt is a list of messages.
1028
+ *
1029
+ * Note: Not all models and prompt formats support multi-modal inputs and
1030
+ * tool calls. The validation happens at runtime.
1031
+ *
1032
+ * Note: This is not a user-facing prompt. The AI SDK methods will map the
1033
+ * user-facing prompt types such as chat or instruction prompts to this format.
1024
1034
  */
1025
- type FilesV4DeleteFileResult = {
1026
- /**
1027
- * A provider reference mapping provider names to provider-specific file identifiers.
1028
- * Contains only the operated provider's entry — when working with a merged
1029
- * multi-provider reference, do not reassign it with this result.
1030
- */
1031
- providerReference: SharedV4ProviderReference;
1032
- /**
1033
- * Whether the provider confirmed the deletion.
1034
- */
1035
- deleted: boolean;
1035
+ type LanguageModelV4Prompt = Array<LanguageModelV4Message>;
1036
+ type LanguageModelV4Message = ({
1037
+ role: 'system';
1038
+ content: string;
1039
+ } | {
1040
+ role: 'user';
1041
+ content: Array<LanguageModelV4TextPart | LanguageModelV4FilePart>;
1042
+ } | {
1043
+ role: 'assistant';
1044
+ content: Array<LanguageModelV4TextPart | LanguageModelV4FilePart | LanguageModelV4CustomPart | LanguageModelV4ReasoningPart | LanguageModelV4ReasoningFilePart | LanguageModelV4ToolCallPart | LanguageModelV4ToolResultPart>;
1045
+ } | {
1046
+ role: 'tool';
1047
+ content: Array<LanguageModelV4ToolResultPart | LanguageModelV4ToolApprovalResponsePart>;
1048
+ }) & {
1036
1049
  /**
1037
- * Additional provider-specific metadata. They are passed through
1050
+ * Additional provider-specific options. They are passed through
1038
1051
  * to the provider from the AI SDK and enable provider-specific
1039
1052
  * functionality that can be fully encapsulated in the provider.
1040
1053
  */
1041
- providerMetadata?: SharedV4ProviderMetadata;
1042
- /**
1043
- * Warnings from the provider.
1044
- */
1045
- warnings: Array<SharedV4Warning>;
1054
+ providerOptions?: SharedV4ProviderOptions;
1046
1055
  };
1047
-
1048
1056
  /**
1049
- * Options for downloading file content via the files interface.
1057
+ * Text content part of a prompt. It contains a string of text.
1050
1058
  */
1051
- type FilesV4DownloadFileCallOptions = {
1052
- /**
1053
- * The provider reference of the file, as returned by `uploadFile`.
1054
- */
1055
- file: SharedV4ProviderReference;
1056
- /**
1057
- * Abort signal for cancelling the operation.
1058
- */
1059
- abortSignal?: AbortSignal;
1059
+ interface LanguageModelV4TextPart {
1060
+ type: 'text';
1060
1061
  /**
1061
- * Additional HTTP headers to be sent with the request.
1062
- * Only applicable for HTTP-based providers.
1062
+ * The text content.
1063
1063
  */
1064
- headers?: Record<string, string | undefined>;
1064
+ text: string;
1065
1065
  /**
1066
1066
  * Additional provider-specific options. They are passed through
1067
1067
  * to the provider from the AI SDK and enable provider-specific
1068
1068
  * functionality that can be fully encapsulated in the provider.
1069
1069
  */
1070
1070
  providerOptions?: SharedV4ProviderOptions;
1071
- };
1072
-
1071
+ }
1073
1072
  /**
1074
- * Result of downloading file content via the files interface.
1073
+ * Reasoning content part of a prompt. It contains a string of reasoning text.
1075
1074
  */
1076
- type FilesV4DownloadFileResult = {
1077
- /**
1078
- * The file content as a byte stream.
1079
- * The consumer is responsible for draining or cancelling the stream.
1080
- */
1081
- content: ReadableStream<Uint8Array>;
1075
+ interface LanguageModelV4ReasoningPart {
1076
+ type: 'reasoning';
1082
1077
  /**
1083
- * The IANA media type of the file, if available from the provider.
1078
+ * The reasoning text.
1084
1079
  */
1085
- mediaType?: string;
1080
+ text: string;
1086
1081
  /**
1087
- * Additional provider-specific metadata. They are passed through
1082
+ * Additional provider-specific options. They are passed through
1088
1083
  * to the provider from the AI SDK and enable provider-specific
1089
1084
  * functionality that can be fully encapsulated in the provider.
1090
1085
  */
1091
- providerMetadata?: SharedV4ProviderMetadata;
1092
- /**
1093
- * Warnings from the provider.
1094
- */
1095
- warnings: Array<SharedV4Warning>;
1096
- };
1097
-
1086
+ providerOptions?: SharedV4ProviderOptions;
1087
+ }
1098
1088
  /**
1099
- * Options for retrieving file metadata via the files interface.
1089
+ * Reasoning file content part of a prompt. It contains a file generated as part of reasoning.
1100
1090
  */
1101
- type FilesV4GetFileMetadataCallOptions = {
1102
- /**
1103
- * The provider reference of the file, as returned by `uploadFile`.
1104
- */
1105
- file: SharedV4ProviderReference;
1091
+ interface LanguageModelV4ReasoningFilePart {
1092
+ type: 'reasoning-file';
1106
1093
  /**
1107
- * Abort signal for cancelling the operation.
1094
+ * File data as a tagged discriminated union:
1095
+ *
1096
+ * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
1097
+ * - `{ type: 'url', url }`: a URL that points to the file.
1108
1098
  */
1109
- abortSignal?: AbortSignal;
1099
+ data: SharedV4FileDataData | SharedV4FileDataUrl;
1110
1100
  /**
1111
- * Additional HTTP headers to be sent with the request.
1112
- * Only applicable for HTTP-based providers.
1101
+ * IANA media type of the file.
1102
+ *
1103
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1113
1104
  */
1114
- headers?: Record<string, string | undefined>;
1105
+ mediaType: string;
1115
1106
  /**
1116
1107
  * Additional provider-specific options. They are passed through
1117
1108
  * to the provider from the AI SDK and enable provider-specific
1118
1109
  * functionality that can be fully encapsulated in the provider.
1119
1110
  */
1120
1111
  providerOptions?: SharedV4ProviderOptions;
1121
- };
1122
-
1112
+ }
1123
1113
  /**
1124
- * Result of retrieving file metadata via the files interface.
1114
+ * Provider-specific content part of a prompt. It contains no standardized
1115
+ * payload beyond provider-specific options.
1125
1116
  */
1126
- type FilesV4GetFileMetadataResult = {
1127
- /**
1128
- * A provider reference mapping provider names to provider-specific file identifiers.
1129
- * Contains only the operated provider's entry — when working with a merged
1130
- * multi-provider reference, do not reassign it with this result.
1131
- */
1132
- providerReference: SharedV4ProviderReference;
1133
- /**
1134
- * The filename of the file, if available from the provider.
1135
- */
1136
- filename?: string;
1137
- /**
1138
- * The IANA media type of the file, if available from the provider.
1139
- */
1140
- mediaType?: string;
1141
- /**
1142
- * The size of the file in bytes, if available from the provider.
1143
- */
1144
- byteSize?: number;
1145
- /**
1146
- * When the file was created, if available from the provider.
1147
- */
1148
- createdAt?: Date;
1117
+ interface LanguageModelV4CustomPart {
1118
+ type: 'custom';
1149
1119
  /**
1150
- * When the provider will delete the file (retention expiry),
1151
- * if available from the provider.
1120
+ * The kind of custom content, in the format `{provider}.{provider-type}`.
1152
1121
  */
1153
- expiresAt?: Date;
1122
+ kind: `${string}.${string}`;
1154
1123
  /**
1155
- * Additional provider-specific metadata. They are passed through
1124
+ * Additional provider-specific options. They are passed through
1156
1125
  * to the provider from the AI SDK and enable provider-specific
1157
1126
  * functionality that can be fully encapsulated in the provider.
1158
1127
  */
1159
- providerMetadata?: SharedV4ProviderMetadata;
1160
- /**
1161
- * Warnings from the provider.
1162
- */
1163
- warnings: Array<SharedV4Warning>;
1164
- };
1165
-
1166
- /**
1167
- * File data variant containing a byte stream. Providers that support
1168
- * streaming uploads send it without buffering the full file in memory.
1169
- */
1170
- interface FilesV4UploadFileStreamData {
1171
- type: 'stream';
1172
- stream: ReadableStream<Uint8Array>;
1128
+ providerOptions?: SharedV4ProviderOptions;
1173
1129
  }
1174
1130
  /**
1175
- * Options for uploading a file via the files interface.
1131
+ * File content part of a prompt. It contains a file.
1176
1132
  */
1177
- type FilesV4UploadFileCallOptions = {
1178
- /**
1179
- * The file data.
1180
- *
1181
- * - `{ type: 'data', data }`: raw bytes (`Uint8Array`) or a base64-encoded string.
1182
- * - `{ type: 'text', text }`: inline text (UTF-8).
1183
- * - `{ type: 'stream', stream }`: a byte stream (not buffered by providers
1184
- * that support streaming uploads).
1185
- */
1186
- data: SharedV4FileDataData | SharedV4FileDataText | FilesV4UploadFileStreamData;
1187
- /**
1188
- * The IANA media type of the file (e.g. `'application/pdf'`).
1189
- */
1190
- mediaType: string;
1133
+ interface LanguageModelV4FilePart {
1134
+ type: 'file';
1191
1135
  /**
1192
- * The filename of the file.
1136
+ * Optional filename of the file.
1193
1137
  */
1194
1138
  filename?: string;
1195
1139
  /**
1196
- * Abort signal for cancelling the operation.
1140
+ * File data as a tagged discriminated union:
1141
+ *
1142
+ * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
1143
+ * - `{ type: 'url', url }`: a URL that points to the file.
1144
+ * - `{ type: 'reference', reference }`: a provider reference (`{ [provider]: id }`).
1145
+ * - `{ type: 'text', text }`: inline text content (e.g. an inline text document).
1197
1146
  */
1198
- abortSignal?: AbortSignal;
1147
+ data: SharedV4FileData;
1199
1148
  /**
1200
- * Additional HTTP headers to be sent with the request.
1201
- * Only applicable for HTTP-based providers.
1149
+ * Either a full IANA media type (`type/subtype`, e.g. `image/png`) or just
1150
+ * the top-level IANA segment (e.g. `image`, `audio`, `video`, `text`).
1151
+ *
1152
+ * `*`-subtype wildcards (e.g. `image/*`) are normalized as equivalent to the
1153
+ * top-level segment alone (e.g. `image`). Providers can use the helpers in
1154
+ * `@ai-sdk/provider-utils` (`isFullMediaType`, `getTopLevelMediaType`,
1155
+ * `detectMediaType`) to resolve the field according to their API
1156
+ * requirements.
1157
+ *
1158
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1202
1159
  */
1203
- headers?: Record<string, string | undefined>;
1160
+ mediaType: string;
1204
1161
  /**
1205
1162
  * Additional provider-specific options. They are passed through
1206
1163
  * to the provider from the AI SDK and enable provider-specific
1207
1164
  * functionality that can be fully encapsulated in the provider.
1208
1165
  */
1209
1166
  providerOptions?: SharedV4ProviderOptions;
1210
- };
1211
-
1167
+ }
1212
1168
  /**
1213
- * Result of uploading a file via the files interface.
1169
+ * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
1214
1170
  */
1215
- type FilesV4UploadFileResult = {
1216
- /**
1217
- * A provider reference mapping provider names to provider-specific file identifiers.
1218
- * The key is the canonical provider name (e.g. `openai`) and may differ from
1219
- * the interface's `provider` id (e.g. `openai.files`).
1220
- */
1221
- providerReference: SharedV4ProviderReference;
1222
- /**
1223
- * The IANA media type of the uploaded file, if available from the provider.
1224
- */
1225
- mediaType?: string;
1171
+ interface LanguageModelV4ToolCallPart {
1172
+ type: 'tool-call';
1226
1173
  /**
1227
- * The filename of the uploaded file, if available from the provider.
1174
+ * ID of the tool call. This ID is used to match the tool call with the tool result.
1228
1175
  */
1229
- filename?: string;
1176
+ toolCallId: string;
1230
1177
  /**
1231
- * The size of the uploaded file in bytes, if available from the provider.
1178
+ * Name of the tool that is being called.
1232
1179
  */
1233
- byteSize?: number;
1180
+ toolName: string;
1234
1181
  /**
1235
- * When the file was created, if available from the provider.
1182
+ * Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
1236
1183
  */
1237
- createdAt?: Date;
1184
+ input: unknown;
1238
1185
  /**
1239
- * When the provider will delete the file (retention expiry, e.g. from a
1240
- * requested upload TTL), if available from the provider.
1186
+ * Whether the tool call will be executed by the provider.
1187
+ * If this flag is not set or is false, the tool call will be executed by the client.
1241
1188
  */
1242
- expiresAt?: Date;
1189
+ providerExecuted?: boolean;
1243
1190
  /**
1244
- * Additional provider-specific metadata. They are passed through
1191
+ * Additional provider-specific options. They are passed through
1245
1192
  * to the provider from the AI SDK and enable provider-specific
1246
1193
  * functionality that can be fully encapsulated in the provider.
1247
1194
  */
1248
- providerMetadata?: SharedV4ProviderMetadata;
1195
+ providerOptions?: SharedV4ProviderOptions;
1196
+ }
1197
+ /**
1198
+ * Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
1199
+ */
1200
+ interface LanguageModelV4ToolResultPart {
1201
+ type: 'tool-result';
1202
+ /**
1203
+ * ID of the tool call that this result is associated with.
1204
+ */
1205
+ toolCallId: string;
1249
1206
  /**
1250
- * Warnings from the provider.
1207
+ * Name of the tool that generated this result.
1251
1208
  */
1252
- warnings: Array<SharedV4Warning>;
1253
- };
1254
-
1255
- /**
1256
- * Specification for a file management interface that implements the files interface version 4.
1257
- *
1258
- * Only `uploadFile` is required. The other operations are optional
1259
- * capabilities: their presence signals that the provider supports them
1260
- * (mirroring the optional-method pattern of `VideoModelV4`).
1261
- */
1262
- type FilesV4 = {
1209
+ toolName: string;
1263
1210
  /**
1264
- * The files interface must specify which files interface version it implements.
1211
+ * Result of the tool call.
1265
1212
  */
1266
- readonly specificationVersion: 'v4';
1213
+ output: LanguageModelV4ToolResultOutput;
1267
1214
  /**
1268
- * Provider ID.
1215
+ * Additional provider-specific options. They are passed through
1216
+ * to the provider from the AI SDK and enable provider-specific
1217
+ * functionality that can be fully encapsulated in the provider.
1269
1218
  */
1270
- readonly provider: string;
1219
+ providerOptions?: SharedV4ProviderOptions;
1220
+ }
1221
+ /**
1222
+ * Tool approval response content part of a prompt. It contains the user's
1223
+ * decision to approve or deny a provider-executed tool call.
1224
+ */
1225
+ interface LanguageModelV4ToolApprovalResponsePart {
1226
+ type: 'tool-approval-response';
1271
1227
  /**
1272
- * Uploads a file to the provider and returns a provider reference
1273
- * that can be used in subsequent API calls.
1228
+ * ID of the approval request that this response refers to.
1274
1229
  */
1275
- uploadFile(options: FilesV4UploadFileCallOptions): PromiseLike<FilesV4UploadFileResult>;
1230
+ approvalId: string;
1276
1231
  /**
1277
- * Retrieves metadata for a previously uploaded file.
1278
- * Optional: presence signals that the provider supports metadata reads.
1232
+ * Whether the approval was granted (true) or denied (false).
1279
1233
  */
1280
- getFileMetadata?(options: FilesV4GetFileMetadataCallOptions): PromiseLike<FilesV4GetFileMetadataResult>;
1234
+ approved: boolean;
1281
1235
  /**
1282
- * Downloads the content of a previously uploaded file as a byte stream.
1283
- * Optional: presence signals that the provider supports content download.
1236
+ * Optional reason for approval or denial.
1284
1237
  */
1285
- downloadFile?(options: FilesV4DownloadFileCallOptions): PromiseLike<FilesV4DownloadFileResult>;
1238
+ reason?: string;
1286
1239
  /**
1287
- * Deletes a previously uploaded file.
1288
- * Optional: presence signals that the provider supports deletion.
1240
+ * Additional provider-specific options. They are passed through
1241
+ * to the provider from the AI SDK and enable provider-specific
1242
+ * functionality that can be fully encapsulated in the provider.
1289
1243
  */
1290
- deleteFile?(options: FilesV4DeleteFileCallOptions): PromiseLike<FilesV4DeleteFileResult>;
1291
- };
1292
-
1244
+ providerOptions?: SharedV4ProviderOptions;
1245
+ }
1293
1246
  /**
1294
- * An image file that can be used for image editing or variation generation.
1247
+ * Result of a tool call.
1295
1248
  */
1296
- type ImageModelV4File = {
1297
- type: 'file';
1249
+ type LanguageModelV4ToolResultOutput = {
1298
1250
  /**
1299
- * The IANA media type of the file, e.g. `image/png`. Any string is supported.
1300
- *
1301
- * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1251
+ * Text tool output that should be directly sent to the API.
1302
1252
  */
1303
- mediaType: string;
1253
+ type: 'text';
1254
+ value: string;
1304
1255
  /**
1305
- * Generated file data as base64 encoded strings or binary data.
1306
- *
1307
- * The file data should be returned without any unnecessary conversion.
1308
- * If the API returns base64 encoded strings, the file data should be returned
1309
- * as base64 encoded strings. If the API returns binary data, the file data should
1310
- * be returned as binary data.
1256
+ * Provider-specific options.
1311
1257
  */
1312
- data: string | Uint8Array;
1258
+ providerOptions?: SharedV4ProviderOptions;
1259
+ } | {
1260
+ type: 'json';
1261
+ value: JSONValue;
1313
1262
  /**
1314
- * Optional provider-specific metadata for the file part.
1263
+ * Provider-specific options.
1315
1264
  */
1316
- providerOptions?: SharedV4ProviderMetadata;
1265
+ providerOptions?: SharedV4ProviderOptions;
1317
1266
  } | {
1318
- type: 'url';
1319
1267
  /**
1320
- * The URL of the image file.
1268
+ * Type when the user has denied the execution of the tool call.
1321
1269
  */
1322
- url: string;
1270
+ type: 'execution-denied';
1323
1271
  /**
1324
- * Optional provider-specific metadata for the file part.
1272
+ * Optional reason for the execution denial.
1325
1273
  */
1326
- providerOptions?: SharedV4ProviderMetadata;
1327
- };
1328
-
1329
- type ImageModelV4CallOptions = {
1274
+ reason?: string;
1330
1275
  /**
1331
- * Prompt for the image generation. Some operations, like upscaling, may not require a prompt.
1276
+ * Provider-specific options.
1332
1277
  */
1333
- prompt: string | undefined;
1278
+ providerOptions?: SharedV4ProviderOptions;
1279
+ } | {
1280
+ type: 'error-text';
1281
+ value: string;
1334
1282
  /**
1335
- * Number of images to generate.
1283
+ * Provider-specific options.
1336
1284
  */
1337
- n: number;
1285
+ providerOptions?: SharedV4ProviderOptions;
1286
+ } | {
1287
+ type: 'error-json';
1288
+ value: JSONValue;
1338
1289
  /**
1339
- * Size of the images to generate.
1340
- * Must have the format `{width}x{height}`.
1341
- * `undefined` will use the provider's default size.
1290
+ * Provider-specific options.
1342
1291
  */
1343
- size: `${number}x${number}` | undefined;
1292
+ providerOptions?: SharedV4ProviderOptions;
1293
+ } | {
1294
+ type: 'content';
1295
+ value: Array<{
1296
+ type: 'text';
1297
+ /**
1298
+ * Text content.
1299
+ */
1300
+ text: string;
1301
+ /**
1302
+ * Provider-specific options.
1303
+ */
1304
+ providerOptions?: SharedV4ProviderOptions;
1305
+ } | {
1306
+ type: 'file';
1307
+ /**
1308
+ * File data as a tagged discriminated union:
1309
+ *
1310
+ * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
1311
+ * - `{ type: 'url', url }`: a URL that points to the file.
1312
+ * - `{ type: 'reference', reference }`: a provider reference (`{ [provider]: id }`).
1313
+ * - `{ type: 'text', text }`: inline text content (e.g. an inline text document).
1314
+ */
1315
+ data: SharedV4FileData;
1316
+ /**
1317
+ * Either a full IANA media type (`type/subtype`, e.g. `image/png`) or just
1318
+ * the top-level IANA segment (e.g. `image`, `audio`, `video`, `text`).
1319
+ *
1320
+ * `*`-subtype wildcards (e.g. `image/*`) are normalized as equivalent to the
1321
+ * top-level segment alone (e.g. `image`). Providers can use the helpers in
1322
+ * `@ai-sdk/provider-utils` (`isFullMediaType`, `getTopLevelMediaType`,
1323
+ * `detectMediaType`) to resolve the field according to their API
1324
+ * requirements.
1325
+ *
1326
+ * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1327
+ */
1328
+ mediaType: string;
1329
+ /**
1330
+ * Optional filename of the file.
1331
+ */
1332
+ filename?: string;
1333
+ /**
1334
+ * Provider-specific options.
1335
+ */
1336
+ providerOptions?: SharedV4ProviderOptions;
1337
+ } | {
1338
+ /**
1339
+ * Custom content part. This can be used to implement
1340
+ * provider-specific content parts.
1341
+ */
1342
+ type: 'custom';
1343
+ /**
1344
+ * Provider-specific options.
1345
+ */
1346
+ providerOptions?: SharedV4ProviderOptions;
1347
+ }>;
1348
+ };
1349
+
1350
+ /**
1351
+ * The configuration of a provider tool.
1352
+ *
1353
+ * Provider tools are tools that are specific to a certain provider.
1354
+ * The input and output schemas are defined be the provider, and
1355
+ * some of the tools are also executed on the provider systems.
1356
+ */
1357
+ type LanguageModelV4ProviderTool = {
1344
1358
  /**
1345
- * Aspect ratio of the images to generate.
1346
- * Must have the format `{width}:{height}`.
1347
- * `undefined` will use the provider's default aspect ratio.
1359
+ * The type of the tool (always 'provider').
1348
1360
  */
1349
- aspectRatio: `${number}:${number}` | undefined;
1361
+ type: 'provider';
1350
1362
  /**
1351
- * Seed for the image generation.
1352
- * `undefined` will use the provider's default seed.
1363
+ * The ID of the tool. Should follow the format `<provider-id>.<unique-tool-name>`.
1353
1364
  */
1354
- seed: number | undefined;
1365
+ id: `${string}.${string}`;
1355
1366
  /**
1356
- * Array of images for image editing or variation generation.
1357
- * The images should be provided as base64 encoded strings or binary data.
1367
+ * The name of the tool. Unique within this model call.
1358
1368
  */
1359
- files: ImageModelV4File[] | undefined;
1369
+ name: string;
1360
1370
  /**
1361
- * Mask image for inpainting operations.
1362
- * The mask should be provided as base64 encoded strings or binary data.
1371
+ * The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
1363
1372
  */
1364
- mask: ImageModelV4File | undefined;
1373
+ args: Record<string, unknown>;
1374
+ };
1375
+
1376
+ type LanguageModelV4ToolChoice = {
1377
+ type: 'auto';
1378
+ } | {
1379
+ type: 'none';
1380
+ } | {
1381
+ type: 'required';
1382
+ } | {
1383
+ type: 'tool';
1384
+ toolName: string;
1385
+ };
1386
+
1387
+ type LanguageModelV4CallOptions = {
1365
1388
  /**
1366
- * Additional provider-specific options that are passed through to the provider
1367
- * as body parameters.
1368
- *
1369
- * The outer record is keyed by the provider name, and the inner
1370
- * record is keyed by the provider-specific metadata key.
1389
+ * A language mode prompt is a standardized prompt type.
1371
1390
  *
1372
- * ```ts
1373
- * {
1374
- * "openai": {
1375
- * "style": "vivid"
1376
- * }
1377
- * }
1378
- * ```
1379
- */
1380
- providerOptions: SharedV4ProviderOptions;
1381
- /**
1382
- * Abort signal for cancelling the operation.
1391
+ * Note: This is **not** the user-facing prompt. The AI SDK methods will map the
1392
+ * user-facing prompt types such as chat or instruction prompts to this format.
1393
+ * That approach allows us to evolve the user facing prompts without breaking
1394
+ * the language model interface.
1383
1395
  */
1384
- abortSignal?: AbortSignal;
1396
+ prompt: LanguageModelV4Prompt;
1385
1397
  /**
1386
- * Additional HTTP headers to be sent with the request.
1387
- * Only applicable for HTTP-based providers.
1398
+ * Maximum number of tokens to generate.
1388
1399
  */
1389
- headers?: Record<string, string | undefined>;
1390
- };
1391
-
1392
- declare function isJSONValue(value: unknown): value is JSONValue;
1393
- declare function isJSONArray(value: unknown): value is JSONArray;
1394
- declare function isJSONObject(value: unknown): value is JSONObject;
1395
-
1396
- /**
1397
- * Usage information for an image model call.
1398
- */
1399
- type ImageModelV4Usage = {
1400
+ maxOutputTokens?: number;
1400
1401
  /**
1401
- * The number of input (prompt) tokens used.
1402
+ * Temperature setting. The range depends on the provider and model.
1402
1403
  */
1403
- inputTokens: number | undefined;
1404
+ temperature?: number;
1404
1405
  /**
1405
- * The number of output tokens used, if reported by the provider.
1406
+ * Stop sequences.
1407
+ * If set, the model will stop generating text when one of the stop sequences is generated.
1408
+ * Providers may have limits on the number of stop sequences.
1406
1409
  */
1407
- outputTokens: number | undefined;
1410
+ stopSequences?: string[];
1408
1411
  /**
1409
- * The total number of tokens as reported by the provider.
1412
+ * Nucleus sampling.
1410
1413
  */
1411
- totalTokens: number | undefined;
1412
- };
1413
-
1414
- type ImageModelV4ProviderMetadata = Record<string, {
1415
- images: JSONArray;
1416
- } & JSONValue>;
1417
- /**
1418
- * The result of an image model doGenerate call.
1419
- */
1420
- type ImageModelV4Result = {
1414
+ topP?: number;
1421
1415
  /**
1422
- * Generated images as base64 encoded strings or binary data.
1423
- * The images should be returned without any unnecessary conversion.
1424
- * If the API returns base64 encoded strings, the images should be returned
1425
- * as base64 encoded strings. If the API returns binary data, the images should
1426
- * be returned as binary data.
1416
+ * Only sample from the top K options for each subsequent token.
1417
+ *
1418
+ * Used to remove "long tail" low probability responses.
1419
+ * Recommended for advanced use cases only. You usually only need to use temperature.
1427
1420
  */
1428
- images: Array<string> | Array<Uint8Array>;
1421
+ topK?: number;
1429
1422
  /**
1430
- * Warnings for the call, e.g. unsupported features.
1423
+ * Presence penalty setting. It affects the likelihood of the model to
1424
+ * repeat information that is already in the prompt.
1431
1425
  */
1432
- warnings: Array<SharedV4Warning>;
1426
+ presencePenalty?: number;
1433
1427
  /**
1434
- * Additional provider-specific metadata. They are passed through
1435
- * from the provider to the AI SDK and enable provider-specific
1436
- * results that can be fully encapsulated in the provider.
1437
- *
1438
- * The outer record is keyed by the provider name, and the inner
1439
- * record is provider-specific metadata. It always includes an
1440
- * `images` key with image-specific metadata
1441
- *
1442
- * ```ts
1443
- * {
1444
- * "openai": {
1445
- * "images": ["revisedPrompt": "Revised prompt here."]
1446
- * }
1447
- * }
1448
- * ```
1428
+ * Frequency penalty setting. It affects the likelihood of the model
1429
+ * to repeatedly use the same words or phrases.
1449
1430
  */
1450
- providerMetadata?: ImageModelV4ProviderMetadata;
1431
+ frequencyPenalty?: number;
1451
1432
  /**
1452
- * Response information for telemetry and debugging purposes.
1433
+ * Response format. The output can either be text or JSON. Default is text.
1434
+ *
1435
+ * If JSON is selected, a schema can optionally be provided to guide the LLM.
1453
1436
  */
1454
- response: {
1437
+ responseFormat?: {
1438
+ type: 'text';
1439
+ } | {
1440
+ type: 'json';
1455
1441
  /**
1456
- * Timestamp for the start of the generated response.
1442
+ * JSON schema that the generated output should conform to.
1457
1443
  */
1458
- timestamp: Date;
1444
+ schema?: JSONSchema7;
1459
1445
  /**
1460
- * The ID of the response model that was used to generate the response.
1446
+ * Name of output that should be generated. Used by some providers for additional LLM guidance.
1461
1447
  */
1462
- modelId: string;
1448
+ name?: string;
1463
1449
  /**
1464
- * Response headers.
1450
+ * Description of the output that should be generated. Used by some providers for additional LLM guidance.
1465
1451
  */
1466
- headers: Record<string, string> | undefined;
1452
+ description?: string;
1467
1453
  };
1468
1454
  /**
1469
- * Optional token usage for the image generation call (if the provider reports it).
1470
- */
1471
- usage?: ImageModelV4Usage;
1472
- };
1473
-
1474
- type GetMaxImagesPerCallFunction$2 = (options: {
1475
- modelId: string;
1476
- }) => PromiseLike<number | undefined> | number | undefined;
1477
- /**
1478
- * Image generation model specification version 4.
1479
- */
1480
- type ImageModelV4 = {
1481
- /**
1482
- * The image model must specify which image model interface
1483
- * version it implements. This will allow us to evolve the image
1484
- * model interface and retain backwards compatibility. The different
1485
- * implementation versions can be handled as a discriminated union
1486
- * on our side.
1455
+ * The seed (integer) to use for random sampling. If set and supported
1456
+ * by the model, calls will generate deterministic results.
1487
1457
  */
1488
- readonly specificationVersion: 'v4';
1458
+ seed?: number;
1489
1459
  /**
1490
- * Name of the provider for logging purposes.
1460
+ * The tools that are available for the model.
1491
1461
  */
1492
- readonly provider: string;
1462
+ tools?: Array<LanguageModelV4FunctionTool | LanguageModelV4ProviderTool>;
1493
1463
  /**
1494
- * Provider-specific model ID for logging purposes.
1464
+ * Specifies how the tool should be selected. Defaults to 'auto'.
1495
1465
  */
1496
- readonly modelId: string;
1466
+ toolChoice?: LanguageModelV4ToolChoice;
1497
1467
  /**
1498
- * Limit of how many images can be generated in a single API call.
1499
- * Can be set to a number for a fixed limit, to undefined to use
1500
- * the global limit, or a function that returns a number or undefined,
1501
- * optionally as a promise.
1468
+ * Include raw chunks in the stream. Only applicable for streaming calls.
1502
1469
  */
1503
- readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction$2;
1470
+ includeRawChunks?: boolean;
1504
1471
  /**
1505
- * Generates an array of images.
1472
+ * Abort signal for cancelling the operation.
1506
1473
  */
1507
- doGenerate(options: ImageModelV4CallOptions): PromiseLike<ImageModelV4Result>;
1508
- };
1509
-
1510
- /**
1511
- * Usage information for an image model call.
1512
- */
1513
- type ImageModelV3Usage = {
1474
+ abortSignal?: AbortSignal;
1514
1475
  /**
1515
- * The number of input (prompt) tokens used.
1476
+ * Additional HTTP headers to be sent with the request.
1477
+ * Only applicable for HTTP-based providers.
1516
1478
  */
1517
- inputTokens: number | undefined;
1479
+ headers?: Record<string, string | undefined>;
1518
1480
  /**
1519
- * The number of output tokens used, if reported by the provider.
1481
+ * Reasoning effort level for the model. Controls how much reasoning
1482
+ * the model performs before generating a response. Defaults to 'provider-default'.
1520
1483
  */
1521
- outputTokens: number | undefined;
1484
+ reasoning?: 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
1522
1485
  /**
1523
- * The total number of tokens as reported by the provider.
1486
+ * Additional provider-specific options. They are passed through
1487
+ * to the provider from the AI SDK and enable provider-specific
1488
+ * functionality that can be fully encapsulated in the provider.
1524
1489
  */
1525
- totalTokens: number | undefined;
1490
+ providerOptions?: SharedV4ProviderOptions;
1526
1491
  };
1527
1492
 
1528
1493
  /**
1529
- * An image file that can be used for image editing or variation generation.
1494
+ * A normalized text generation request within a batch.
1530
1495
  */
1531
- type ImageModelV3File = {
1532
- type: 'file';
1533
- /**
1534
- * The IANA media type of the file, e.g. `image/png`. Any string is supported.
1535
- *
1536
- * @see https://www.iana.org/assignments/media-types/media-types.xhtml
1537
- */
1538
- mediaType: string;
1496
+ type TextBatchV4Request<ModelId extends string = string> = BatchV4RequestBase<ModelId> & {
1497
+ readonly type: 'text';
1498
+ readonly options: Pick<LanguageModelV4CallOptions, 'prompt' | 'maxOutputTokens' | 'temperature' | 'stopSequences' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'seed' | 'reasoning' | 'responseFormat' | 'toolChoice' | 'tools' | 'providerOptions'>;
1499
+ };
1500
+
1501
+ /**
1502
+ * Model IDs accepted by each batch modality.
1503
+ *
1504
+ * Additional modality-specific model ID types can be added to this mapping.
1505
+ */
1506
+ type BatchV4ModelIds = {
1507
+ readonly text?: string;
1508
+ readonly image?: string;
1509
+ };
1510
+ type BatchV4CallOptions = {
1511
+ readonly providerOptions?: SharedV4ProviderOptions;
1512
+ readonly abortSignal?: AbortSignal;
1513
+ readonly headers?: Record<string, string | undefined>;
1514
+ };
1515
+ type BatchV4StartCallOptions = BatchV4CallOptions & {
1539
1516
  /**
1540
- * Generated file data as base64 encoded strings or binary data.
1541
- *
1542
- * The file data should be returned without any unnecessary conversion.
1543
- * If the API returns base64 encoded strings, the file data should be returned
1544
- * as base64 encoded strings. If the API returns binary data, the file data should
1545
- * be returned as binary data.
1517
+ * URL the provider notifies when the batch reaches a terminal state.
1518
+ * Providers that do not support completion webhooks should return an
1519
+ * unsupported warning.
1546
1520
  */
1547
- data: string | Uint8Array;
1521
+ readonly webhookUrl?: string;
1522
+ };
1523
+ /**
1524
+ * Serializable error information for a batch or batch item.
1525
+ */
1526
+ type BatchV4Error = {
1527
+ readonly message: string;
1528
+ readonly type?: string;
1529
+ readonly code?: string;
1530
+ readonly statusCode?: number;
1531
+ };
1532
+ /**
1533
+ * Normalized lifecycle status for a batch.
1534
+ */
1535
+ type BatchV4Status = {
1536
+ readonly status: 'pending' | 'completed' | 'failed';
1537
+ readonly rawStatus?: string;
1538
+ readonly requestCounts?: {
1539
+ readonly total: number;
1540
+ readonly pending: number;
1541
+ readonly completed: number;
1542
+ readonly failed: number;
1543
+ };
1544
+ readonly error?: BatchV4Error;
1545
+ readonly createdAt?: string;
1546
+ readonly expiresAt?: string;
1547
+ readonly providerMetadata?: SharedV4ProviderMetadata;
1548
+ };
1549
+ type BatchV4Request<ModelIds extends BatchV4ModelIds = BatchV4ModelIds> = TextBatchV4Request<ModelIds['text'] & string> | ImageBatchV4Request<ModelIds['image'] & string>;
1550
+ /**
1551
+ * Options for starting a batch of requests discriminated by modality.
1552
+ *
1553
+ * Additional modality-specific request variants can be added to
1554
+ * `BatchV4Request`.
1555
+ */
1556
+ type BatchV4StartOptions<ModelIds extends BatchV4ModelIds = BatchV4ModelIds> = BatchV4StartCallOptions & {
1557
+ readonly requests: ReadonlyArray<BatchV4Request<ModelIds>>;
1558
+ };
1559
+ /**
1560
+ * Result of starting a batch.
1561
+ */
1562
+ type BatchV4StartResult = BatchV4Status & {
1563
+ readonly batchId: string;
1564
+ readonly warnings: Array<{
1565
+ readonly requestId?: string;
1566
+ readonly warning: SharedV4Warning;
1567
+ }>;
1568
+ };
1569
+ /**
1570
+ * Options for a batch status or results operation.
1571
+ */
1572
+ type BatchV4OperationOptions = {
1573
+ readonly batchId: string;
1574
+ } & BatchV4CallOptions;
1575
+ /**
1576
+ * Result of requesting cancellation of a batch.
1577
+ */
1578
+ type BatchV4CancelResult = {
1579
+ readonly providerMetadata?: SharedV4ProviderMetadata;
1580
+ };
1581
+ /**
1582
+ * Options for listing batches.
1583
+ */
1584
+ type BatchV4ListOptions = BatchV4CallOptions & {
1585
+ readonly limit?: number;
1586
+ readonly cursor?: string;
1587
+ };
1588
+ /**
1589
+ * A batch returned by a list operation.
1590
+ */
1591
+ type BatchV4ListItem = BatchV4Status & {
1592
+ readonly batchId: string;
1593
+ };
1594
+ /**
1595
+ * Result of listing batches.
1596
+ */
1597
+ type BatchV4ListResult = {
1598
+ readonly batches: Array<BatchV4ListItem>;
1599
+ readonly nextCursor?: string;
1600
+ readonly providerMetadata?: SharedV4ProviderMetadata;
1601
+ };
1602
+ type BatchV4ItemResultBase<RESULT> = {
1603
+ readonly id: string;
1604
+ readonly status: 'succeeded';
1605
+ readonly result: RESULT;
1606
+ } | {
1607
+ readonly id: string;
1608
+ readonly status: 'failed';
1609
+ readonly error: BatchV4Error;
1610
+ readonly providerMetadata?: SharedV4ProviderMetadata;
1611
+ } | {
1612
+ readonly id: string;
1613
+ readonly status: 'cancelled' | 'expired';
1614
+ readonly error?: BatchV4Error;
1615
+ readonly providerMetadata?: SharedV4ProviderMetadata;
1616
+ };
1617
+ /**
1618
+ * A complete terminal result for one request in a text batch.
1619
+ */
1620
+ type TextBatchV4ItemResult = {
1621
+ readonly type: 'text';
1622
+ } & BatchV4ItemResultBase<LanguageModelV4GenerateResult>;
1623
+ /**
1624
+ * A complete terminal result for one request in an image batch.
1625
+ */
1626
+ type ImageBatchV4ItemResult = {
1627
+ readonly type: 'image';
1628
+ } & BatchV4ItemResultBase<ImageModelV4Result>;
1629
+ /**
1630
+ * A complete terminal result for one request in a batch, discriminated by
1631
+ * modality.
1632
+ *
1633
+ * Additional modality-specific item results can be added to this union.
1634
+ */
1635
+ type BatchV4ItemResult = TextBatchV4ItemResult | ImageBatchV4ItemResult;
1636
+ /**
1637
+ * Specification for a batch interface that implements batch interface version 4.
1638
+ */
1639
+ type BatchV4<ModelIds extends BatchV4ModelIds = BatchV4ModelIds> = {
1548
1640
  /**
1549
- * Optional provider-specific metadata for the file part.
1641
+ * The batch interface must specify which batch interface version it implements.
1550
1642
  */
1551
- providerOptions?: SharedV3ProviderMetadata;
1552
- } | {
1553
- type: 'url';
1643
+ readonly specificationVersion: 'v4';
1554
1644
  /**
1555
- * The URL of the image file.
1645
+ * Provider ID.
1556
1646
  */
1557
- url: string;
1647
+ readonly provider: string;
1558
1648
  /**
1559
- * Optional provider-specific metadata for the file part.
1649
+ * Supported URL patterns by media type for requests in this batch interface.
1560
1650
  */
1561
- providerOptions?: SharedV3ProviderMetadata;
1651
+ readonly supportedUrls: PromiseLike<Record<string, RegExp[]>> | Record<string, RegExp[]>;
1652
+ doStartBatch(options: BatchV4StartOptions<ModelIds>): PromiseLike<BatchV4StartResult>;
1653
+ doGetBatchStatus(options: BatchV4OperationOptions): PromiseLike<BatchV4Status>;
1654
+ doGetBatchResults(options: BatchV4OperationOptions): PromiseLike<ReadableStream<BatchV4ItemResult>>;
1655
+ doCancelBatch?(options: BatchV4OperationOptions): PromiseLike<BatchV4CancelResult>;
1656
+ doListBatches?(options: BatchV4ListOptions): PromiseLike<BatchV4ListResult>;
1562
1657
  };
1563
1658
 
1564
- type ImageModelV3CallOptions = {
1565
- /**
1566
- * Prompt for the image generation. Some operations, like upscaling, may not require a prompt.
1567
- */
1568
- prompt: string | undefined;
1659
+ type EmbeddingModelV4CallOptions = {
1569
1660
  /**
1570
- * Number of images to generate.
1661
+ * List of text values to generate embeddings for.
1571
1662
  */
1572
- n: number;
1663
+ values: Array<string>;
1573
1664
  /**
1574
- * Size of the images to generate.
1575
- * Must have the format `{width}x{height}`.
1576
- * `undefined` will use the provider's default size.
1665
+ * Abort signal for cancelling the operation.
1577
1666
  */
1578
- size: `${number}x${number}` | undefined;
1667
+ abortSignal?: AbortSignal;
1579
1668
  /**
1580
- * Aspect ratio of the images to generate.
1581
- * Must have the format `{width}:{height}`.
1582
- * `undefined` will use the provider's default aspect ratio.
1669
+ * Additional provider-specific options. They are passed through
1670
+ * to the provider from the AI SDK and enable provider-specific
1671
+ * functionality that can be fully encapsulated in the provider.
1583
1672
  */
1584
- aspectRatio: `${number}:${number}` | undefined;
1673
+ providerOptions?: SharedV4ProviderOptions;
1585
1674
  /**
1586
- * Seed for the image generation.
1587
- * `undefined` will use the provider's default seed.
1675
+ * Additional HTTP headers to be sent with the request.
1676
+ * Only applicable for HTTP-based providers.
1588
1677
  */
1589
- seed: number | undefined;
1678
+ headers?: SharedV4Headers;
1679
+ };
1680
+
1681
+ /**
1682
+ * An embedding is a vector, i.e. an array of numbers.
1683
+ * It is e.g. used to represent a text as a vector of word embeddings.
1684
+ */
1685
+ type EmbeddingModelV4Embedding = Array<number>;
1686
+
1687
+ /**
1688
+ * The result of a embedding model doEmbed call.
1689
+ */
1690
+ type EmbeddingModelV4Result = {
1590
1691
  /**
1591
- * Array of images for image editing or variation generation.
1592
- * The images should be provided as base64 encoded strings or binary data.
1692
+ * Generated embeddings. They are in the same order as the input values.
1593
1693
  */
1594
- files: ImageModelV3File[] | undefined;
1694
+ embeddings: Array<EmbeddingModelV4Embedding>;
1595
1695
  /**
1596
- * Mask image for inpainting operations.
1597
- * The mask should be provided as base64 encoded strings or binary data.
1696
+ * Token usage. We only have input tokens for embeddings.
1598
1697
  */
1599
- mask: ImageModelV3File | undefined;
1698
+ usage?: {
1699
+ tokens: number;
1700
+ };
1600
1701
  /**
1601
- * Additional provider-specific options that are passed through to the provider
1602
- * as body parameters.
1603
- *
1604
- * The outer record is keyed by the provider name, and the inner
1605
- * record is keyed by the provider-specific metadata key.
1606
- *
1607
- * ```ts
1608
- * {
1609
- * "openai": {
1610
- * "style": "vivid"
1611
- * }
1612
- * }
1613
- * ```
1702
+ * Additional provider-specific metadata. They are passed through
1703
+ * from the provider to the AI SDK and enable provider-specific
1704
+ * results that can be fully encapsulated in the provider.
1614
1705
  */
1615
- providerOptions: SharedV3ProviderOptions;
1706
+ providerMetadata?: SharedV4ProviderMetadata;
1616
1707
  /**
1617
- * Abort signal for cancelling the operation.
1708
+ * Optional response information for debugging purposes.
1618
1709
  */
1619
- abortSignal?: AbortSignal;
1710
+ response?: {
1711
+ /**
1712
+ * Response headers.
1713
+ */
1714
+ headers?: SharedV4Headers;
1715
+ /**
1716
+ * The response body.
1717
+ */
1718
+ body?: unknown;
1719
+ };
1620
1720
  /**
1621
- * Additional HTTP headers to be sent with the request.
1622
- * Only applicable for HTTP-based providers.
1721
+ * Warnings for the call, e.g. unsupported settings.
1623
1722
  */
1624
- headers?: Record<string, string | undefined>;
1723
+ warnings: Array<SharedV4Warning>;
1625
1724
  };
1626
1725
 
1627
- type ImageModelV3ProviderMetadata = Record<string, {
1628
- images: JSONArray;
1629
- } & JSONValue>;
1630
- type GetMaxImagesPerCallFunction$1 = (options: {
1631
- modelId: string;
1632
- }) => PromiseLike<number | undefined> | number | undefined;
1633
1726
  /**
1634
- * Image generation model specification version 3.
1727
+ * Specification for an embedding model that implements the embedding model
1728
+ * interface version 4.
1729
+ *
1730
+ * It is specific to text embeddings.
1635
1731
  */
1636
- type ImageModelV3 = {
1732
+ type EmbeddingModelV4 = {
1637
1733
  /**
1638
- * The image model must specify which image model interface
1639
- * version it implements. This will allow us to evolve the image
1734
+ * The embedding model must specify which embedding model interface
1735
+ * version it implements. This will allow us to evolve the embedding
1640
1736
  * model interface and retain backwards compatibility. The different
1641
1737
  * implementation versions can be handled as a discriminated union
1642
1738
  * on our side.
1643
1739
  */
1644
- readonly specificationVersion: 'v3';
1740
+ readonly specificationVersion: 'v4';
1645
1741
  /**
1646
1742
  * Name of the provider for logging purposes.
1647
1743
  */
@@ -1651,829 +1747,797 @@ type ImageModelV3 = {
1651
1747
  */
1652
1748
  readonly modelId: string;
1653
1749
  /**
1654
- * Limit of how many images can be generated in a single API call.
1655
- * Can be set to a number for a fixed limit, to undefined to use
1656
- * the global limit, or a function that returns a number or undefined,
1657
- * optionally as a promise.
1658
- */
1659
- readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction$1;
1660
- /**
1661
- * Generates an array of images.
1662
- */
1663
- doGenerate(options: ImageModelV3CallOptions): PromiseLike<{
1664
- /**
1665
- * Generated images as base64 encoded strings or binary data.
1666
- * The images should be returned without any unnecessary conversion.
1667
- * If the API returns base64 encoded strings, the images should be returned
1668
- * as base64 encoded strings. If the API returns binary data, the images should
1669
- * be returned as binary data.
1670
- */
1671
- images: Array<string> | Array<Uint8Array>;
1672
- /**
1673
- * Warnings for the call, e.g. unsupported features.
1674
- */
1675
- warnings: Array<SharedV3Warning>;
1676
- /**
1677
- * Additional provider-specific metadata. They are passed through
1678
- * from the provider to the AI SDK and enable provider-specific
1679
- * results that can be fully encapsulated in the provider.
1680
- *
1681
- * The outer record is keyed by the provider name, and the inner
1682
- * record is provider-specific metadata. It always includes an
1683
- * `images` key with image-specific metadata
1684
- *
1685
- * ```ts
1686
- * {
1687
- * "openai": {
1688
- * "images": ["revisedPrompt": "Revised prompt here."]
1689
- * }
1690
- * }
1691
- * ```
1692
- */
1693
- providerMetadata?: ImageModelV3ProviderMetadata;
1694
- /**
1695
- * Response information for telemetry and debugging purposes.
1696
- */
1697
- response: {
1698
- /**
1699
- * Timestamp for the start of the generated response.
1700
- */
1701
- timestamp: Date;
1702
- /**
1703
- * The ID of the response model that was used to generate the response.
1704
- */
1705
- modelId: string;
1706
- /**
1707
- * Response headers.
1708
- */
1709
- headers: Record<string, string> | undefined;
1710
- };
1711
- /**
1712
- * Optional token usage for the image generation call (if the provider reports it).
1713
- */
1714
- usage?: ImageModelV3Usage;
1715
- }>;
1716
- };
1717
-
1718
- type ImageModelV2CallOptions = {
1719
- /**
1720
- * Prompt for the image generation.
1721
- */
1722
- prompt: string;
1723
- /**
1724
- * Number of images to generate.
1725
- */
1726
- n: number;
1727
- /**
1728
- * Size of the images to generate.
1729
- * Must have the format `{width}x{height}`.
1730
- * `undefined` will use the provider's default size.
1750
+ * Limit of how many embeddings can be generated in a single API call.
1751
+ *
1752
+ * Use Infinity for models that do not have a limit.
1731
1753
  */
1732
- size: `${number}x${number}` | undefined;
1754
+ readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
1733
1755
  /**
1734
- * Aspect ratio of the images to generate.
1735
- * Must have the format `{width}:{height}`.
1736
- * `undefined` will use the provider's default aspect ratio.
1756
+ * True if the model can handle multiple embedding calls in parallel.
1737
1757
  */
1738
- aspectRatio: `${number}:${number}` | undefined;
1758
+ readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
1739
1759
  /**
1740
- * Seed for the image generation.
1741
- * `undefined` will use the provider's default seed.
1760
+ * Generates a list of embeddings for the given input text.
1761
+ *
1762
+ * Naming: "do" prefix to prevent accidental direct usage of the method
1763
+ * by the user.
1742
1764
  */
1743
- seed: number | undefined;
1765
+ doEmbed(options: EmbeddingModelV4CallOptions): PromiseLike<EmbeddingModelV4Result>;
1766
+ };
1767
+
1768
+ type EmbeddingModelV3CallOptions = {
1744
1769
  /**
1745
- * Additional provider-specific options that are passed through to the provider
1746
- * as body parameters.
1747
- *
1748
- * The outer record is keyed by the provider name, and the inner
1749
- * record is keyed by the provider-specific metadata key.
1750
- * ```ts
1751
- * {
1752
- * "openai": {
1753
- * "style": "vivid"
1754
- * }
1755
- * }
1756
- * ```
1770
+ * List of text values to generate embeddings for.
1757
1771
  */
1758
- providerOptions: SharedV2ProviderOptions;
1772
+ values: Array<string>;
1759
1773
  /**
1760
1774
  * Abort signal for cancelling the operation.
1761
1775
  */
1762
1776
  abortSignal?: AbortSignal;
1777
+ /**
1778
+ * Additional provider-specific options. They are passed through
1779
+ * to the provider from the AI SDK and enable provider-specific
1780
+ * functionality that can be fully encapsulated in the provider.
1781
+ */
1782
+ providerOptions?: SharedV3ProviderOptions;
1763
1783
  /**
1764
1784
  * Additional HTTP headers to be sent with the request.
1765
1785
  * Only applicable for HTTP-based providers.
1766
1786
  */
1767
- headers?: Record<string, string | undefined>;
1768
- };
1769
-
1770
- /**
1771
- * Warning from the model provider for this call. The call will proceed, but e.g.
1772
- * some settings might not be supported, which can lead to suboptimal results.
1773
- */
1774
- type ImageModelV2CallWarning = {
1775
- type: 'unsupported-setting';
1776
- setting: keyof ImageModelV2CallOptions;
1777
- details?: string;
1778
- } | {
1779
- type: 'other';
1780
- message: string;
1787
+ headers?: SharedV3Headers;
1781
1788
  };
1782
1789
 
1783
- type ImageModelV2ProviderMetadata = Record<string, {
1784
- images: JSONArray;
1785
- } & JSONValue>;
1786
- type GetMaxImagesPerCallFunction = (options: {
1787
- modelId: string;
1788
- }) => PromiseLike<number | undefined> | number | undefined;
1789
1790
  /**
1790
- * Image generation model specification version 2.
1791
+ * An embedding is a vector, i.e. an array of numbers.
1792
+ * It is e.g. used to represent a text as a vector of word embeddings.
1791
1793
  */
1792
- type ImageModelV2 = {
1793
- /**
1794
- * The image model must specify which image model interface
1795
- * version it implements. This will allow us to evolve the image
1796
- * model interface and retain backwards compatibility. The different
1797
- * implementation versions can be handled as a discriminated union
1798
- * on our side.
1799
- */
1800
- readonly specificationVersion: 'v2';
1794
+ type EmbeddingModelV3Embedding = Array<number>;
1795
+
1796
+ /**
1797
+ * The result of a embedding model doEmbed call.
1798
+ */
1799
+ type EmbeddingModelV3Result = {
1801
1800
  /**
1802
- * Name of the provider for logging purposes.
1801
+ * Generated embeddings. They are in the same order as the input values.
1803
1802
  */
1804
- readonly provider: string;
1803
+ embeddings: Array<EmbeddingModelV3Embedding>;
1805
1804
  /**
1806
- * Provider-specific model ID for logging purposes.
1805
+ * Token usage. We only have input tokens for embeddings.
1807
1806
  */
1808
- readonly modelId: string;
1807
+ usage?: {
1808
+ tokens: number;
1809
+ };
1809
1810
  /**
1810
- * Limit of how many images can be generated in a single API call.
1811
- * Can be set to a number for a fixed limit, to undefined to use
1812
- * the global limit, or a function that returns a number or undefined,
1813
- * optionally as a promise.
1811
+ * Additional provider-specific metadata. They are passed through
1812
+ * from the provider to the AI SDK and enable provider-specific
1813
+ * results that can be fully encapsulated in the provider.
1814
1814
  */
1815
- readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction;
1815
+ providerMetadata?: SharedV3ProviderMetadata;
1816
1816
  /**
1817
- * Generates an array of images.
1817
+ * Optional response information for debugging purposes.
1818
1818
  */
1819
- doGenerate(options: ImageModelV2CallOptions): PromiseLike<{
1820
- /**
1821
- * Generated images as base64 encoded strings or binary data.
1822
- * The images should be returned without any unnecessary conversion.
1823
- * If the API returns base64 encoded strings, the images should be returned
1824
- * as base64 encoded strings. If the API returns binary data, the images should
1825
- * be returned as binary data.
1826
- */
1827
- images: Array<string> | Array<Uint8Array>;
1828
- /**
1829
- * Warnings for the call, e.g. unsupported settings.
1830
- */
1831
- warnings: Array<ImageModelV2CallWarning>;
1819
+ response?: {
1832
1820
  /**
1833
- * Additional provider-specific metadata. They are passed through
1834
- * from the provider to the AI SDK and enable provider-specific
1835
- * results that can be fully encapsulated in the provider.
1836
- *
1837
- * The outer record is keyed by the provider name, and the inner
1838
- * record is provider-specific metadata. It always includes an
1839
- * `images` key with image-specific metadata
1840
- *
1841
- * ```ts
1842
- * {
1843
- * "openai": {
1844
- * "images": ["revisedPrompt": "Revised prompt here."]
1845
- * }
1846
- * }
1847
- * ```
1821
+ * Response headers.
1848
1822
  */
1849
- providerMetadata?: ImageModelV2ProviderMetadata;
1823
+ headers?: SharedV3Headers;
1850
1824
  /**
1851
- * Response information for telemetry and debugging purposes.
1825
+ * The response body.
1852
1826
  */
1853
- response: {
1854
- /**
1855
- * Timestamp for the start of the generated response.
1856
- */
1857
- timestamp: Date;
1858
- /**
1859
- * The ID of the response model that was used to generate the response.
1860
- */
1861
- modelId: string;
1862
- /**
1863
- * Response headers.
1864
- */
1865
- headers: Record<string, string> | undefined;
1866
- };
1867
- }>;
1827
+ body?: unknown;
1828
+ };
1829
+ /**
1830
+ * Warnings for the call, e.g. unsupported settings.
1831
+ */
1832
+ warnings: Array<SharedV3Warning>;
1868
1833
  };
1869
1834
 
1870
1835
  /**
1871
- * Middleware for ImageModelV4.
1872
- * This type defines the structure for middleware that can be used to modify
1873
- * the behavior of ImageModelV4 operations.
1836
+ * Specification for an embedding model that implements the embedding model
1837
+ * interface version 3.
1838
+ *
1839
+ * It is specific to text embeddings.
1874
1840
  */
1875
- type ImageModelV4Middleware = {
1841
+ type EmbeddingModelV3 = {
1876
1842
  /**
1877
- * Middleware specification version. Use `v4` for the current version.
1843
+ * The embedding model must specify which embedding model interface
1844
+ * version it implements. This will allow us to evolve the embedding
1845
+ * model interface and retain backwards compatibility. The different
1846
+ * implementation versions can be handled as a discriminated union
1847
+ * on our side.
1878
1848
  */
1879
- readonly specificationVersion: 'v4';
1849
+ readonly specificationVersion: 'v3';
1880
1850
  /**
1881
- * Override the provider name if desired.
1882
- * @param options.model - The image model instance.
1851
+ * Name of the provider for logging purposes.
1883
1852
  */
1884
- overrideProvider?: (options: {
1885
- model: ImageModelV4;
1886
- }) => string;
1853
+ readonly provider: string;
1887
1854
  /**
1888
- * Override the model ID if desired.
1889
- * @param options.model - The image model instance.
1855
+ * Provider-specific model ID for logging purposes.
1890
1856
  */
1891
- overrideModelId?: (options: {
1892
- model: ImageModelV4;
1893
- }) => string;
1857
+ readonly modelId: string;
1894
1858
  /**
1895
- * Override the limit of how many images can be generated in a single API call if desired.
1896
- * @param options.model - The image model instance.
1859
+ * Limit of how many embeddings can be generated in a single API call.
1860
+ *
1861
+ * Use Infinity for models that do not have a limit.
1897
1862
  */
1898
- overrideMaxImagesPerCall?: (options: {
1899
- model: ImageModelV4;
1900
- }) => ImageModelV4['maxImagesPerCall'];
1863
+ readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
1901
1864
  /**
1902
- * Transforms the parameters before they are passed to the image model.
1903
- * @param options - Object containing the parameters.
1904
- * @param options.params - The original parameters for the image model call.
1905
- * @returns A promise that resolves to the transformed parameters.
1865
+ * True if the model can handle multiple embedding calls in parallel.
1906
1866
  */
1907
- transformParams?: (options: {
1908
- params: ImageModelV4CallOptions;
1909
- model: ImageModelV4;
1910
- }) => PromiseLike<ImageModelV4CallOptions>;
1867
+ readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
1911
1868
  /**
1912
- * Wraps the generate operation of the image model.
1869
+ * Generates a list of embeddings for the given input text.
1913
1870
  *
1914
- * @param options - Object containing the generate function, parameters, and model.
1915
- * @param options.doGenerate - The original generate function.
1916
- * @param options.params - The parameters for the generate call. If the
1917
- * `transformParams` middleware is used, this will be the transformed parameters.
1918
- * @param options.model - The image model instance.
1919
- * @returns A promise that resolves to the result of the generate operation.
1871
+ * Naming: "do" prefix to prevent accidental direct usage of the method
1872
+ * by the user.
1920
1873
  */
1921
- wrapGenerate?: (options: {
1922
- doGenerate: () => ReturnType<ImageModelV4['doGenerate']>;
1923
- params: ImageModelV4CallOptions;
1924
- model: ImageModelV4;
1925
- }) => Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>>;
1874
+ doEmbed(options: EmbeddingModelV3CallOptions): PromiseLike<EmbeddingModelV3Result>;
1926
1875
  };
1927
1876
 
1928
1877
  /**
1929
- * Middleware for ImageModelV3.
1930
- * This type defines the structure for middleware that can be used to modify
1931
- * the behavior of ImageModelV3 operations.
1878
+ * An embedding is a vector, i.e. an array of numbers.
1879
+ * It is e.g. used to represent a text as a vector of word embeddings.
1932
1880
  */
1933
- type ImageModelV3Middleware = {
1881
+ type EmbeddingModelV2Embedding = Array<number>;
1882
+
1883
+ /**
1884
+ * Specification for an embedding model that implements the embedding model
1885
+ * interface version 2.
1886
+ *
1887
+ * VALUE is the type of the values that the model can embed.
1888
+ * This will allow us to go beyond text embeddings in the future,
1889
+ * e.g. to support image embeddings
1890
+ */
1891
+ type EmbeddingModelV2<VALUE> = {
1934
1892
  /**
1935
- * Middleware specification version. Use `v3` for the current version.
1893
+ * The embedding model must specify which embedding model interface
1894
+ * version it implements. This will allow us to evolve the embedding
1895
+ * model interface and retain backwards compatibility. The different
1896
+ * implementation versions can be handled as a discriminated union
1897
+ * on our side.
1936
1898
  */
1937
- readonly specificationVersion: 'v3';
1899
+ readonly specificationVersion: 'v2';
1938
1900
  /**
1939
- * Override the provider name if desired.
1940
- * @param options.model - The image model instance.
1901
+ * Name of the provider for logging purposes.
1941
1902
  */
1942
- overrideProvider?: (options: {
1943
- model: ImageModelV3;
1944
- }) => string;
1903
+ readonly provider: string;
1945
1904
  /**
1946
- * Override the model ID if desired.
1947
- * @param options.model - The image model instance.
1905
+ * Provider-specific model ID for logging purposes.
1948
1906
  */
1949
- overrideModelId?: (options: {
1950
- model: ImageModelV3;
1951
- }) => string;
1907
+ readonly modelId: string;
1952
1908
  /**
1953
- * Override the limit of how many images can be generated in a single API call if desired.
1954
- * @param options.model - The image model instance.
1909
+ * Limit of how many embeddings can be generated in a single API call.
1910
+ *
1911
+ * Use Infinity for models that do not have a limit.
1955
1912
  */
1956
- overrideMaxImagesPerCall?: (options: {
1957
- model: ImageModelV3;
1958
- }) => ImageModelV3['maxImagesPerCall'];
1913
+ readonly maxEmbeddingsPerCall: PromiseLike<number | undefined> | number | undefined;
1959
1914
  /**
1960
- * Transforms the parameters before they are passed to the image model.
1961
- * @param options - Object containing the parameters.
1962
- * @param options.params - The original parameters for the image model call.
1963
- * @returns A promise that resolves to the transformed parameters.
1915
+ * True if the model can handle multiple embedding calls in parallel.
1964
1916
  */
1965
- transformParams?: (options: {
1966
- params: ImageModelV3CallOptions;
1967
- model: ImageModelV3;
1968
- }) => PromiseLike<ImageModelV3CallOptions>;
1917
+ readonly supportsParallelCalls: PromiseLike<boolean> | boolean;
1969
1918
  /**
1970
- * Wraps the generate operation of the image model.
1919
+ * Generates a list of embeddings for the given input text.
1971
1920
  *
1972
- * @param options - Object containing the generate function, parameters, and model.
1973
- * @param options.doGenerate - The original generate function.
1974
- * @param options.params - The parameters for the generate call. If the
1975
- * `transformParams` middleware is used, this will be the transformed parameters.
1976
- * @param options.model - The image model instance.
1977
- * @returns A promise that resolves to the result of the generate operation.
1921
+ * Naming: "do" prefix to prevent accidental direct usage of the method
1922
+ * by the user.
1978
1923
  */
1979
- wrapGenerate?: (options: {
1980
- doGenerate: () => ReturnType<ImageModelV3['doGenerate']>;
1981
- params: ImageModelV3CallOptions;
1982
- model: ImageModelV3;
1983
- }) => Promise<Awaited<ReturnType<ImageModelV3['doGenerate']>>>;
1924
+ doEmbed(options: {
1925
+ /**
1926
+ * List of values to embed.
1927
+ */
1928
+ values: Array<VALUE>;
1929
+ /**
1930
+ * Abort signal for cancelling the operation.
1931
+ */
1932
+ abortSignal?: AbortSignal;
1933
+ /**
1934
+ * Additional provider-specific options. They are passed through
1935
+ * to the provider from the AI SDK and enable provider-specific
1936
+ * functionality that can be fully encapsulated in the provider.
1937
+ */
1938
+ providerOptions?: SharedV2ProviderOptions;
1939
+ /**
1940
+ * Additional HTTP headers to be sent with the request.
1941
+ * Only applicable for HTTP-based providers.
1942
+ */
1943
+ headers?: Record<string, string | undefined>;
1944
+ }): PromiseLike<{
1945
+ /**
1946
+ * Generated embeddings. They are in the same order as the input values.
1947
+ */
1948
+ embeddings: Array<EmbeddingModelV2Embedding>;
1949
+ /**
1950
+ * Token usage. We only have input tokens for embeddings.
1951
+ */
1952
+ usage?: {
1953
+ tokens: number;
1954
+ };
1955
+ /**
1956
+ * Additional provider-specific metadata. They are passed through
1957
+ * from the provider to the AI SDK and enable provider-specific
1958
+ * results that can be fully encapsulated in the provider.
1959
+ */
1960
+ providerMetadata?: SharedV2ProviderMetadata;
1961
+ /**
1962
+ * Optional response information for debugging purposes.
1963
+ */
1964
+ response?: {
1965
+ /**
1966
+ * Response headers.
1967
+ */
1968
+ headers?: SharedV2Headers;
1969
+ /**
1970
+ * The response body.
1971
+ */
1972
+ body?: unknown;
1973
+ };
1974
+ }>;
1984
1975
  };
1985
1976
 
1977
+ declare const symbol$f: unique symbol;
1986
1978
  /**
1987
- * A tool has a name, a description, and a set of parameters.
1988
- *
1989
- * Note: this is **not** the user-facing tool definition. The AI SDK methods will
1990
- * map the user-facing tool definitions to this format.
1979
+ * Custom error class for AI SDK related errors.
1980
+ * @extends Error
1991
1981
  */
1992
- type LanguageModelV4FunctionTool = {
1993
- /**
1994
- * The type of the tool (always 'function').
1995
- */
1996
- type: 'function';
1997
- /**
1998
- * The name of the tool. Unique within this model call.
1999
- */
2000
- name: string;
2001
- /**
2002
- * A description of the tool. The language model uses this to understand the
2003
- * tool's purpose and to provide better completion suggestions.
2004
- */
2005
- description?: string;
2006
- /**
2007
- * The parameters that the tool expects. The language model uses this to
2008
- * understand the tool's input requirements and to provide matching suggestions.
2009
- */
2010
- inputSchema: JSONSchema7;
1982
+ declare class AISDKError extends Error {
1983
+ private readonly [symbol$f];
2011
1984
  /**
2012
- * An optional list of input examples that show the language
2013
- * model what the input should look like.
1985
+ * The underlying cause of the error, if any.
2014
1986
  */
2015
- inputExamples?: Array<{
2016
- input: JSONObject;
2017
- }>;
1987
+ readonly cause?: unknown;
2018
1988
  /**
2019
- * Strict mode setting for the tool.
1989
+ * Creates an AI SDK Error.
2020
1990
  *
2021
- * Providers that support strict mode will use this setting to determine
2022
- * how the input should be generated. Strict mode will always produce
2023
- * valid inputs, but it might limit what input schemas are supported.
1991
+ * @param {Object} params - The parameters for creating the error.
1992
+ * @param {string} params.name - The name of the error.
1993
+ * @param {string} params.message - The error message.
1994
+ * @param {unknown} [params.cause] - The underlying cause of the error.
2024
1995
  */
2025
- strict?: boolean;
1996
+ constructor({ name, message, cause, }: {
1997
+ name: string;
1998
+ message: string;
1999
+ cause?: unknown;
2000
+ });
2026
2001
  /**
2027
- * The provider-specific options for the tool.
2002
+ * Checks if the given error is an AI SDK Error.
2003
+ * @param {unknown} error - The error to check.
2004
+ * @returns {boolean} True if the error is an AI SDK Error, false otherwise.
2028
2005
  */
2029
- providerOptions?: SharedV4ProviderOptions;
2030
- };
2006
+ static isInstance(error: unknown): error is AISDKError;
2007
+ protected static hasMarker(error: unknown, marker: string): boolean;
2008
+ }
2009
+
2010
+ declare const symbol$e: unique symbol;
2011
+ declare class APICallError extends AISDKError {
2012
+ private readonly [symbol$e];
2013
+ readonly url: string;
2014
+ readonly requestBodyValues: unknown;
2015
+ readonly statusCode?: number;
2016
+ readonly responseHeaders?: Record<string, string>;
2017
+ readonly responseBody?: string;
2018
+ readonly isRetryable: boolean;
2019
+ readonly data?: unknown;
2020
+ constructor({ message, url, requestBodyValues, statusCode, responseHeaders, responseBody, cause, isRetryable, // server error
2021
+ data, }: {
2022
+ message: string;
2023
+ url: string;
2024
+ requestBodyValues: unknown;
2025
+ statusCode?: number;
2026
+ responseHeaders?: Record<string, string>;
2027
+ responseBody?: string;
2028
+ cause?: unknown;
2029
+ isRetryable?: boolean;
2030
+ data?: unknown;
2031
+ });
2032
+ static isInstance(error: unknown): error is APICallError;
2033
+ }
2034
+
2035
+ declare const symbol$d: unique symbol;
2036
+ declare class EmptyResponseBodyError extends AISDKError {
2037
+ private readonly [symbol$d];
2038
+ constructor({ message }?: {
2039
+ message?: string;
2040
+ });
2041
+ static isInstance(error: unknown): error is EmptyResponseBodyError;
2042
+ }
2031
2043
 
2044
+ declare const symbol$c: unique symbol;
2032
2045
  /**
2033
- * A prompt is a list of messages.
2034
- *
2035
- * Note: Not all models and prompt formats support multi-modal inputs and
2036
- * tool calls. The validation happens at runtime.
2037
- *
2038
- * Note: This is not a user-facing prompt. The AI SDK methods will map the
2039
- * user-facing prompt types such as chat or instruction prompts to this format.
2046
+ * An evaluation model does not support the type of a requested question.
2040
2047
  */
2041
- type LanguageModelV4Prompt = Array<LanguageModelV4Message>;
2042
- type LanguageModelV4Message = ({
2043
- role: 'system';
2044
- content: string;
2045
- } | {
2046
- role: 'user';
2047
- content: Array<LanguageModelV4TextPart | LanguageModelV4FilePart>;
2048
- } | {
2049
- role: 'assistant';
2050
- content: Array<LanguageModelV4TextPart | LanguageModelV4FilePart | LanguageModelV4CustomPart | LanguageModelV4ReasoningPart | LanguageModelV4ReasoningFilePart | LanguageModelV4ToolCallPart | LanguageModelV4ToolResultPart>;
2051
- } | {
2052
- role: 'tool';
2053
- content: Array<LanguageModelV4ToolResultPart | LanguageModelV4ToolApprovalResponsePart>;
2054
- }) & {
2055
- /**
2056
- * Additional provider-specific options. They are passed through
2057
- * to the provider from the AI SDK and enable provider-specific
2058
- * functionality that can be fully encapsulated in the provider.
2059
- */
2060
- providerOptions?: SharedV4ProviderOptions;
2061
- };
2048
+ declare class EvaluationUnsupportedQuestionTypeError extends AISDKError {
2049
+ private readonly [symbol$c];
2050
+ readonly questionId: string;
2051
+ readonly questionType: string;
2052
+ readonly provider: string;
2053
+ readonly modelId: string;
2054
+ constructor({ questionId, questionType, provider, modelId, message, }: {
2055
+ questionId: string;
2056
+ questionType: string;
2057
+ provider: string;
2058
+ modelId: string;
2059
+ message?: string;
2060
+ });
2061
+ static isInstance(error: unknown): error is EvaluationUnsupportedQuestionTypeError;
2062
+ }
2063
+
2064
+ declare function getErrorMessage(error: unknown | undefined): string;
2065
+
2066
+ declare const symbol$b: unique symbol;
2062
2067
  /**
2063
- * Text content part of a prompt. It contains a string of text.
2068
+ * A function argument is invalid.
2064
2069
  */
2065
- interface LanguageModelV4TextPart {
2066
- type: 'text';
2067
- /**
2068
- * The text content.
2069
- */
2070
- text: string;
2071
- /**
2072
- * Additional provider-specific options. They are passed through
2073
- * to the provider from the AI SDK and enable provider-specific
2074
- * functionality that can be fully encapsulated in the provider.
2075
- */
2076
- providerOptions?: SharedV4ProviderOptions;
2070
+ declare class InvalidArgumentError extends AISDKError {
2071
+ private readonly [symbol$b];
2072
+ readonly argument: string;
2073
+ constructor({ message, cause, argument, }: {
2074
+ argument: string;
2075
+ message: string;
2076
+ cause?: unknown;
2077
+ });
2078
+ static isInstance(error: unknown): error is InvalidArgumentError;
2077
2079
  }
2080
+
2081
+ declare const symbol$a: unique symbol;
2078
2082
  /**
2079
- * Reasoning content part of a prompt. It contains a string of reasoning text.
2083
+ * A prompt is invalid. This error should be thrown by providers when they cannot
2084
+ * process a prompt.
2080
2085
  */
2081
- interface LanguageModelV4ReasoningPart {
2082
- type: 'reasoning';
2083
- /**
2084
- * The reasoning text.
2085
- */
2086
- text: string;
2087
- /**
2088
- * Additional provider-specific options. They are passed through
2089
- * to the provider from the AI SDK and enable provider-specific
2090
- * functionality that can be fully encapsulated in the provider.
2091
- */
2092
- providerOptions?: SharedV4ProviderOptions;
2086
+ declare class InvalidPromptError extends AISDKError {
2087
+ private readonly [symbol$a];
2088
+ readonly prompt: unknown;
2089
+ constructor({ prompt, message, cause, }: {
2090
+ prompt: unknown;
2091
+ message: string;
2092
+ cause?: unknown;
2093
+ });
2094
+ static isInstance(error: unknown): error is InvalidPromptError;
2093
2095
  }
2096
+
2097
+ declare const symbol$9: unique symbol;
2094
2098
  /**
2095
- * Reasoning file content part of a prompt. It contains a file generated as part of reasoning.
2099
+ * Server returned a response with invalid data content.
2100
+ * This should be thrown by providers when they cannot parse the response from the API.
2096
2101
  */
2097
- interface LanguageModelV4ReasoningFilePart {
2098
- type: 'reasoning-file';
2099
- /**
2100
- * File data as a tagged discriminated union:
2101
- *
2102
- * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
2103
- * - `{ type: 'url', url }`: a URL that points to the file.
2104
- */
2105
- data: SharedV4FileDataData | SharedV4FileDataUrl;
2106
- /**
2107
- * IANA media type of the file.
2108
- *
2109
- * @see https://www.iana.org/assignments/media-types/media-types.xhtml
2110
- */
2111
- mediaType: string;
2112
- /**
2113
- * Additional provider-specific options. They are passed through
2114
- * to the provider from the AI SDK and enable provider-specific
2115
- * functionality that can be fully encapsulated in the provider.
2116
- */
2117
- providerOptions?: SharedV4ProviderOptions;
2102
+ declare class InvalidResponseDataError extends AISDKError {
2103
+ private readonly [symbol$9];
2104
+ readonly data: unknown;
2105
+ constructor({ data, message, }: {
2106
+ data: unknown;
2107
+ message?: string;
2108
+ });
2109
+ static isInstance(error: unknown): error is InvalidResponseDataError;
2110
+ }
2111
+
2112
+ declare const symbol$8: unique symbol;
2113
+ declare class JSONParseError extends AISDKError {
2114
+ private readonly [symbol$8];
2115
+ readonly text: string;
2116
+ constructor({ text, cause }: {
2117
+ text: string;
2118
+ cause: unknown;
2119
+ });
2120
+ static isInstance(error: unknown): error is JSONParseError;
2118
2121
  }
2119
- /**
2120
- * Provider-specific content part of a prompt. It contains no standardized
2121
- * payload beyond provider-specific options.
2122
- */
2123
- interface LanguageModelV4CustomPart {
2124
- type: 'custom';
2125
- /**
2126
- * The kind of custom content, in the format `{provider}.{provider-type}`.
2127
- */
2128
- kind: `${string}.${string}`;
2129
- /**
2130
- * Additional provider-specific options. They are passed through
2131
- * to the provider from the AI SDK and enable provider-specific
2132
- * functionality that can be fully encapsulated in the provider.
2133
- */
2134
- providerOptions?: SharedV4ProviderOptions;
2122
+
2123
+ declare const symbol$7: unique symbol;
2124
+ declare class LoadAPIKeyError extends AISDKError {
2125
+ private readonly [symbol$7];
2126
+ constructor({ message }: {
2127
+ message: string;
2128
+ });
2129
+ static isInstance(error: unknown): error is LoadAPIKeyError;
2130
+ }
2131
+
2132
+ declare const symbol$6: unique symbol;
2133
+ declare class LoadSettingError extends AISDKError {
2134
+ private readonly [symbol$6];
2135
+ constructor({ message }: {
2136
+ message: string;
2137
+ });
2138
+ static isInstance(error: unknown): error is LoadSettingError;
2135
2139
  }
2140
+
2141
+ declare const symbol$5: unique symbol;
2136
2142
  /**
2137
- * File content part of a prompt. It contains a file.
2143
+ * Thrown when the AI provider fails to generate any content.
2138
2144
  */
2139
- interface LanguageModelV4FilePart {
2140
- type: 'file';
2141
- /**
2142
- * Optional filename of the file.
2143
- */
2144
- filename?: string;
2145
- /**
2146
- * File data as a tagged discriminated union:
2147
- *
2148
- * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
2149
- * - `{ type: 'url', url }`: a URL that points to the file.
2150
- * - `{ type: 'reference', reference }`: a provider reference (`{ [provider]: id }`).
2151
- * - `{ type: 'text', text }`: inline text content (e.g. an inline text document).
2152
- */
2153
- data: SharedV4FileData;
2154
- /**
2155
- * Either a full IANA media type (`type/subtype`, e.g. `image/png`) or just
2156
- * the top-level IANA segment (e.g. `image`, `audio`, `video`, `text`).
2157
- *
2158
- * `*`-subtype wildcards (e.g. `image/*`) are normalized as equivalent to the
2159
- * top-level segment alone (e.g. `image`). Providers can use the helpers in
2160
- * `@ai-sdk/provider-utils` (`isFullMediaType`, `getTopLevelMediaType`,
2161
- * `detectMediaType`) to resolve the field according to their API
2162
- * requirements.
2163
- *
2164
- * @see https://www.iana.org/assignments/media-types/media-types.xhtml
2165
- */
2166
- mediaType: string;
2167
- /**
2168
- * Additional provider-specific options. They are passed through
2169
- * to the provider from the AI SDK and enable provider-specific
2170
- * functionality that can be fully encapsulated in the provider.
2171
- */
2172
- providerOptions?: SharedV4ProviderOptions;
2145
+ declare class NoContentGeneratedError extends AISDKError {
2146
+ private readonly [symbol$5];
2147
+ constructor({ message, }?: {
2148
+ message?: string;
2149
+ });
2150
+ static isInstance(error: unknown): error is NoContentGeneratedError;
2151
+ }
2152
+
2153
+ declare const symbol$4: unique symbol;
2154
+ declare class NoSuchModelError extends AISDKError {
2155
+ private readonly [symbol$4];
2156
+ readonly modelId: string;
2157
+ readonly modelType: 'languageModel' | 'embeddingModel' | 'imageModel' | 'transcriptionModel' | 'speechModel' | 'rerankingModel' | 'videoModel' | 'evaluationModel';
2158
+ constructor({ errorName, modelId, modelType, message, }: {
2159
+ errorName?: string;
2160
+ modelId: string;
2161
+ modelType: 'languageModel' | 'embeddingModel' | 'imageModel' | 'transcriptionModel' | 'speechModel' | 'rerankingModel' | 'videoModel' | 'evaluationModel';
2162
+ message?: string;
2163
+ });
2164
+ static isInstance(error: unknown): error is NoSuchModelError;
2173
2165
  }
2166
+
2167
+ declare const symbol$3: unique symbol;
2174
2168
  /**
2175
- * Tool call content part of a prompt. It contains a tool call (usually generated by the AI model).
2169
+ * Thrown when a provider reference cannot be resolved because the specified
2170
+ * provider is not found in the provider reference mapping.
2176
2171
  */
2177
- interface LanguageModelV4ToolCallPart {
2178
- type: 'tool-call';
2179
- /**
2180
- * ID of the tool call. This ID is used to match the tool call with the tool result.
2181
- */
2182
- toolCallId: string;
2183
- /**
2184
- * Name of the tool that is being called.
2185
- */
2186
- toolName: string;
2172
+ declare class NoSuchProviderReferenceError extends AISDKError {
2173
+ private readonly [symbol$3];
2174
+ readonly provider: string;
2175
+ readonly reference: SharedV4ProviderReference;
2176
+ constructor({ provider, reference, message, }: {
2177
+ provider: string;
2178
+ reference: SharedV4ProviderReference;
2179
+ message?: string;
2180
+ });
2181
+ static isInstance(error: unknown): error is NoSuchProviderReferenceError;
2182
+ }
2183
+
2184
+ declare const symbol$2: unique symbol;
2185
+ declare class TooManyEmbeddingValuesForCallError extends AISDKError {
2186
+ private readonly [symbol$2];
2187
+ readonly provider: string;
2188
+ readonly modelId: string;
2189
+ readonly maxEmbeddingsPerCall: number;
2190
+ readonly values: Array<unknown>;
2191
+ constructor(options: {
2192
+ provider: string;
2193
+ modelId: string;
2194
+ maxEmbeddingsPerCall: number;
2195
+ values: Array<unknown>;
2196
+ });
2197
+ static isInstance(error: unknown): error is TooManyEmbeddingValuesForCallError;
2198
+ }
2199
+
2200
+ declare const symbol$1: unique symbol;
2201
+ interface TypeValidationContext {
2187
2202
  /**
2188
- * Arguments of the tool call. This is a JSON-serializable object that matches the tool's input schema.
2203
+ * Field path in dot notation (e.g., "message.metadata", "message.parts[3].data")
2189
2204
  */
2190
- input: unknown;
2205
+ field?: string;
2191
2206
  /**
2192
- * Whether the tool call will be executed by the provider.
2193
- * If this flag is not set or is false, the tool call will be executed by the client.
2207
+ * Entity name (e.g., tool name, data type name)
2194
2208
  */
2195
- providerExecuted?: boolean;
2209
+ entityName?: string;
2196
2210
  /**
2197
- * Additional provider-specific options. They are passed through
2198
- * to the provider from the AI SDK and enable provider-specific
2199
- * functionality that can be fully encapsulated in the provider.
2211
+ * Entity identifier (e.g., message ID, tool call ID)
2200
2212
  */
2201
- providerOptions?: SharedV4ProviderOptions;
2213
+ entityId?: string;
2202
2214
  }
2203
- /**
2204
- * Tool result content part of a prompt. It contains the result of the tool call with the matching ID.
2205
- */
2206
- interface LanguageModelV4ToolResultPart {
2207
- type: 'tool-result';
2208
- /**
2209
- * ID of the tool call that this result is associated with.
2210
- */
2211
- toolCallId: string;
2215
+ declare class TypeValidationError extends AISDKError {
2216
+ private readonly [symbol$1];
2217
+ readonly value: unknown;
2218
+ readonly context?: TypeValidationContext;
2219
+ constructor({ value, cause, context, }: {
2220
+ value: unknown;
2221
+ cause: unknown;
2222
+ context?: TypeValidationContext;
2223
+ });
2224
+ static isInstance(error: unknown): error is TypeValidationError;
2212
2225
  /**
2213
- * Name of the tool that generated this result.
2226
+ * Wraps an error into a TypeValidationError.
2227
+ * If the cause is already a TypeValidationError with the same value and context, it returns the cause.
2228
+ * Otherwise, it creates a new TypeValidationError.
2229
+ *
2230
+ * @param {Object} params - The parameters for wrapping the error.
2231
+ * @param {unknown} params.value - The value that failed validation.
2232
+ * @param {unknown} params.cause - The original error or cause of the validation failure.
2233
+ * @param {TypeValidationContext} params.context - Optional context about what is being validated.
2234
+ * @returns {TypeValidationError} A TypeValidationError instance.
2214
2235
  */
2215
- toolName: string;
2236
+ static wrap({ value, cause, context, }: {
2237
+ value: unknown;
2238
+ cause: unknown;
2239
+ context?: TypeValidationContext;
2240
+ }): TypeValidationError;
2241
+ }
2242
+
2243
+ declare const symbol: unique symbol;
2244
+ declare class UnsupportedFunctionalityError extends AISDKError {
2245
+ private readonly [symbol];
2246
+ readonly functionality: string;
2247
+ constructor({ functionality, message, }: {
2248
+ functionality: string;
2249
+ message?: string;
2250
+ });
2251
+ static isInstance(error: unknown): error is UnsupportedFunctionalityError;
2252
+ }
2253
+
2254
+ /** Shared state or structured instructions for an evaluation. */
2255
+ type EvaluationModelV4Input = string | Readonly<JSONObject> | readonly JSONValue[];
2256
+ /** A judgment to make about the shared state. */
2257
+ type EvaluationModelV4Question = {
2258
+ readonly type: 'choice';
2259
+ readonly instructions: EvaluationModelV4Input;
2260
+ /** Nonempty map of option names to descriptions. Null means no description. */
2261
+ readonly criteria: Readonly<Record<string, EvaluationModelV4Input | null>>;
2262
+ } | {
2263
+ readonly type: 'score';
2264
+ readonly instructions: EvaluationModelV4Input;
2265
+ /** At least two ordered levels, indexed from zero. */
2266
+ readonly criteria: readonly (EvaluationModelV4Input | null)[];
2267
+ } | {
2268
+ readonly type: 'boolean';
2269
+ readonly instructions: EvaluationModelV4Input;
2270
+ readonly criteria?: {
2271
+ readonly true?: EvaluationModelV4Input | null;
2272
+ readonly false?: EvaluationModelV4Input | null;
2273
+ };
2274
+ };
2275
+
2276
+ type EvaluationModelV4CallOptions = {
2277
+ /** One shared state, even when the value is an array. */
2278
+ state: EvaluationModelV4Input;
2279
+ questions: Readonly<Record<string, EvaluationModelV4Question>>;
2280
+ abortSignal?: AbortSignal;
2281
+ headers?: SharedV4Headers;
2282
+ providerOptions?: SharedV4ProviderOptions;
2283
+ };
2284
+
2285
+ type EvaluationModelV4Answer = {
2286
+ type: 'choice';
2287
+ /** The selected option, with maximal probability when a distribution exists. */
2288
+ choice: string;
2289
+ /** Complete distribution over the question's options, when available. */
2290
+ probabilities?: Record<string, number>;
2291
+ } | {
2292
+ type: 'score';
2293
+ /** Fractional position in [0, number of levels - 1]. */
2294
+ score: number;
2216
2295
  /**
2217
- * Result of the tool call.
2296
+ * Complete distribution, keyed by zero-based level indices as strings.
2297
+ * When supplied, score is its probability-weighted mean.
2218
2298
  */
2219
- output: LanguageModelV4ToolResultOutput;
2299
+ probabilities?: Record<string, number>;
2300
+ } | {
2301
+ type: 'boolean';
2302
+ /** Model-estimated P(true), in [0, 1]. Not confidence in either outcome. */
2303
+ probability: number;
2304
+ };
2305
+ type EvaluationModelV4Result = {
2306
+ /** Exactly one answer per question, under the original question IDs. */
2307
+ answers: Record<string, EvaluationModelV4Answer>;
2220
2308
  /**
2221
- * Additional provider-specific options. They are passed through
2222
- * to the provider from the AI SDK and enable provider-specific
2223
- * functionality that can be fully encapsulated in the provider.
2309
+ * Decimal places used when the provider rounds its output. Omit for full
2310
+ * precision. Core allows half a unit in the last place per rounded value
2311
+ * when checking distribution sums and weighted scores, preserving the values.
2224
2312
  */
2225
- providerOptions?: SharedV4ProviderOptions;
2226
- }
2313
+ rounding?: {
2314
+ probabilityDecimals?: number;
2315
+ scoreDecimals?: number;
2316
+ };
2317
+ usage?: {
2318
+ inputTokens?: number;
2319
+ outputTokens?: number;
2320
+ };
2321
+ warnings: SharedV4Warning[];
2322
+ providerMetadata?: SharedV4ProviderMetadata;
2323
+ response?: {
2324
+ id?: string;
2325
+ timestamp?: Date;
2326
+ modelId?: string;
2327
+ headers?: SharedV4Headers;
2328
+ body?: unknown;
2329
+ };
2330
+ };
2331
+
2332
+ /** Experimental evaluation model contract. May change in patch releases. */
2333
+ type EvaluationModelV4 = {
2334
+ readonly specificationVersion: 'v4';
2335
+ readonly provider: string;
2336
+ readonly modelId: string;
2337
+ /** Supported question types, used to reject unsupported calls before any I/O. */
2338
+ readonly supportedQuestionTypes: readonly EvaluationModelV4Question['type'][];
2339
+ /** Evaluate every question against the same state. No partial results. */
2340
+ doEvaluate(options: EvaluationModelV4CallOptions): PromiseLike<EvaluationModelV4Result>;
2341
+ };
2342
+
2227
2343
  /**
2228
- * Tool approval response content part of a prompt. It contains the user's
2229
- * decision to approve or deny a provider-executed tool call.
2344
+ * Options for deleting a file via the files interface.
2230
2345
  */
2231
- interface LanguageModelV4ToolApprovalResponsePart {
2232
- type: 'tool-approval-response';
2346
+ type FilesV4DeleteFileCallOptions = {
2233
2347
  /**
2234
- * ID of the approval request that this response refers to.
2348
+ * The provider reference of the file, as returned by `uploadFile`.
2235
2349
  */
2236
- approvalId: string;
2350
+ file: SharedV4ProviderReference;
2237
2351
  /**
2238
- * Whether the approval was granted (true) or denied (false).
2352
+ * Abort signal for cancelling the operation.
2239
2353
  */
2240
- approved: boolean;
2354
+ abortSignal?: AbortSignal;
2241
2355
  /**
2242
- * Optional reason for approval or denial.
2356
+ * Additional HTTP headers to be sent with the request.
2357
+ * Only applicable for HTTP-based providers.
2243
2358
  */
2244
- reason?: string;
2359
+ headers?: Record<string, string | undefined>;
2245
2360
  /**
2246
2361
  * Additional provider-specific options. They are passed through
2247
2362
  * to the provider from the AI SDK and enable provider-specific
2248
2363
  * functionality that can be fully encapsulated in the provider.
2249
2364
  */
2250
2365
  providerOptions?: SharedV4ProviderOptions;
2251
- }
2366
+ };
2367
+
2252
2368
  /**
2253
- * Result of a tool call.
2369
+ * Result of deleting a file via the files interface.
2254
2370
  */
2255
- type LanguageModelV4ToolResultOutput = {
2371
+ type FilesV4DeleteFileResult = {
2256
2372
  /**
2257
- * Text tool output that should be directly sent to the API.
2373
+ * A provider reference mapping provider names to provider-specific file identifiers.
2374
+ * Contains only the operated provider's entry — when working with a merged
2375
+ * multi-provider reference, do not reassign it with this result.
2258
2376
  */
2259
- type: 'text';
2260
- value: string;
2377
+ providerReference: SharedV4ProviderReference;
2261
2378
  /**
2262
- * Provider-specific options.
2379
+ * Whether the provider confirmed the deletion.
2263
2380
  */
2264
- providerOptions?: SharedV4ProviderOptions;
2265
- } | {
2266
- type: 'json';
2267
- value: JSONValue;
2381
+ deleted: boolean;
2268
2382
  /**
2269
- * Provider-specific options.
2383
+ * Additional provider-specific metadata. They are passed through
2384
+ * to the provider from the AI SDK and enable provider-specific
2385
+ * functionality that can be fully encapsulated in the provider.
2270
2386
  */
2271
- providerOptions?: SharedV4ProviderOptions;
2272
- } | {
2387
+ providerMetadata?: SharedV4ProviderMetadata;
2273
2388
  /**
2274
- * Type when the user has denied the execution of the tool call.
2389
+ * Warnings from the provider.
2275
2390
  */
2276
- type: 'execution-denied';
2391
+ warnings: Array<SharedV4Warning>;
2392
+ };
2393
+
2394
+ /**
2395
+ * Options for downloading file content via the files interface.
2396
+ */
2397
+ type FilesV4DownloadFileCallOptions = {
2277
2398
  /**
2278
- * Optional reason for the execution denial.
2399
+ * The provider reference of the file, as returned by `uploadFile`.
2279
2400
  */
2280
- reason?: string;
2401
+ file: SharedV4ProviderReference;
2281
2402
  /**
2282
- * Provider-specific options.
2403
+ * Abort signal for cancelling the operation.
2283
2404
  */
2284
- providerOptions?: SharedV4ProviderOptions;
2285
- } | {
2286
- type: 'error-text';
2287
- value: string;
2405
+ abortSignal?: AbortSignal;
2288
2406
  /**
2289
- * Provider-specific options.
2407
+ * Additional HTTP headers to be sent with the request.
2408
+ * Only applicable for HTTP-based providers.
2290
2409
  */
2291
- providerOptions?: SharedV4ProviderOptions;
2292
- } | {
2293
- type: 'error-json';
2294
- value: JSONValue;
2410
+ headers?: Record<string, string | undefined>;
2295
2411
  /**
2296
- * Provider-specific options.
2412
+ * Additional provider-specific options. They are passed through
2413
+ * to the provider from the AI SDK and enable provider-specific
2414
+ * functionality that can be fully encapsulated in the provider.
2297
2415
  */
2298
2416
  providerOptions?: SharedV4ProviderOptions;
2299
- } | {
2300
- type: 'content';
2301
- value: Array<{
2302
- type: 'text';
2303
- /**
2304
- * Text content.
2305
- */
2306
- text: string;
2307
- /**
2308
- * Provider-specific options.
2309
- */
2310
- providerOptions?: SharedV4ProviderOptions;
2311
- } | {
2312
- type: 'file';
2313
- /**
2314
- * File data as a tagged discriminated union:
2315
- *
2316
- * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
2317
- * - `{ type: 'url', url }`: a URL that points to the file.
2318
- * - `{ type: 'reference', reference }`: a provider reference (`{ [provider]: id }`).
2319
- * - `{ type: 'text', text }`: inline text content (e.g. an inline text document).
2320
- */
2321
- data: SharedV4FileData;
2322
- /**
2323
- * Either a full IANA media type (`type/subtype`, e.g. `image/png`) or just
2324
- * the top-level IANA segment (e.g. `image`, `audio`, `video`, `text`).
2325
- *
2326
- * `*`-subtype wildcards (e.g. `image/*`) are normalized as equivalent to the
2327
- * top-level segment alone (e.g. `image`). Providers can use the helpers in
2328
- * `@ai-sdk/provider-utils` (`isFullMediaType`, `getTopLevelMediaType`,
2329
- * `detectMediaType`) to resolve the field according to their API
2330
- * requirements.
2331
- *
2332
- * @see https://www.iana.org/assignments/media-types/media-types.xhtml
2333
- */
2334
- mediaType: string;
2335
- /**
2336
- * Optional filename of the file.
2337
- */
2338
- filename?: string;
2339
- /**
2340
- * Provider-specific options.
2341
- */
2342
- providerOptions?: SharedV4ProviderOptions;
2343
- } | {
2344
- /**
2345
- * Custom content part. This can be used to implement
2346
- * provider-specific content parts.
2347
- */
2348
- type: 'custom';
2349
- /**
2350
- * Provider-specific options.
2351
- */
2352
- providerOptions?: SharedV4ProviderOptions;
2353
- }>;
2354
2417
  };
2355
2418
 
2356
2419
  /**
2357
- * The configuration of a provider tool.
2358
- *
2359
- * Provider tools are tools that are specific to a certain provider.
2360
- * The input and output schemas are defined be the provider, and
2361
- * some of the tools are also executed on the provider systems.
2420
+ * Result of downloading file content via the files interface.
2362
2421
  */
2363
- type LanguageModelV4ProviderTool = {
2422
+ type FilesV4DownloadFileResult = {
2364
2423
  /**
2365
- * The type of the tool (always 'provider').
2424
+ * The file content as a byte stream.
2425
+ * The consumer is responsible for draining or cancelling the stream.
2366
2426
  */
2367
- type: 'provider';
2427
+ content: ReadableStream<Uint8Array>;
2368
2428
  /**
2369
- * The ID of the tool. Should follow the format `<provider-id>.<unique-tool-name>`.
2429
+ * The IANA media type of the file, if available from the provider.
2370
2430
  */
2371
- id: `${string}.${string}`;
2431
+ mediaType?: string;
2372
2432
  /**
2373
- * The name of the tool. Unique within this model call.
2433
+ * Additional provider-specific metadata. They are passed through
2434
+ * to the provider from the AI SDK and enable provider-specific
2435
+ * functionality that can be fully encapsulated in the provider.
2374
2436
  */
2375
- name: string;
2437
+ providerMetadata?: SharedV4ProviderMetadata;
2376
2438
  /**
2377
- * The arguments for configuring the tool. Must match the expected arguments defined by the provider for this tool.
2439
+ * Warnings from the provider.
2378
2440
  */
2379
- args: Record<string, unknown>;
2380
- };
2381
-
2382
- type LanguageModelV4ToolChoice = {
2383
- type: 'auto';
2384
- } | {
2385
- type: 'none';
2386
- } | {
2387
- type: 'required';
2388
- } | {
2389
- type: 'tool';
2390
- toolName: string;
2441
+ warnings: Array<SharedV4Warning>;
2391
2442
  };
2392
2443
 
2393
- type LanguageModelV4CallOptions = {
2444
+ /**
2445
+ * Options for retrieving file metadata via the files interface.
2446
+ */
2447
+ type FilesV4GetFileMetadataCallOptions = {
2394
2448
  /**
2395
- * A language mode prompt is a standardized prompt type.
2396
- *
2397
- * Note: This is **not** the user-facing prompt. The AI SDK methods will map the
2398
- * user-facing prompt types such as chat or instruction prompts to this format.
2399
- * That approach allows us to evolve the user facing prompts without breaking
2400
- * the language model interface.
2449
+ * The provider reference of the file, as returned by `uploadFile`.
2401
2450
  */
2402
- prompt: LanguageModelV4Prompt;
2451
+ file: SharedV4ProviderReference;
2403
2452
  /**
2404
- * Maximum number of tokens to generate.
2453
+ * Abort signal for cancelling the operation.
2405
2454
  */
2406
- maxOutputTokens?: number;
2455
+ abortSignal?: AbortSignal;
2407
2456
  /**
2408
- * Temperature setting. The range depends on the provider and model.
2457
+ * Additional HTTP headers to be sent with the request.
2458
+ * Only applicable for HTTP-based providers.
2409
2459
  */
2410
- temperature?: number;
2460
+ headers?: Record<string, string | undefined>;
2411
2461
  /**
2412
- * Stop sequences.
2413
- * If set, the model will stop generating text when one of the stop sequences is generated.
2414
- * Providers may have limits on the number of stop sequences.
2462
+ * Additional provider-specific options. They are passed through
2463
+ * to the provider from the AI SDK and enable provider-specific
2464
+ * functionality that can be fully encapsulated in the provider.
2415
2465
  */
2416
- stopSequences?: string[];
2466
+ providerOptions?: SharedV4ProviderOptions;
2467
+ };
2468
+
2469
+ /**
2470
+ * Result of retrieving file metadata via the files interface.
2471
+ */
2472
+ type FilesV4GetFileMetadataResult = {
2417
2473
  /**
2418
- * Nucleus sampling.
2474
+ * A provider reference mapping provider names to provider-specific file identifiers.
2475
+ * Contains only the operated provider's entry — when working with a merged
2476
+ * multi-provider reference, do not reassign it with this result.
2419
2477
  */
2420
- topP?: number;
2478
+ providerReference: SharedV4ProviderReference;
2421
2479
  /**
2422
- * Only sample from the top K options for each subsequent token.
2423
- *
2424
- * Used to remove "long tail" low probability responses.
2425
- * Recommended for advanced use cases only. You usually only need to use temperature.
2480
+ * The filename of the file, if available from the provider.
2426
2481
  */
2427
- topK?: number;
2482
+ filename?: string;
2428
2483
  /**
2429
- * Presence penalty setting. It affects the likelihood of the model to
2430
- * repeat information that is already in the prompt.
2484
+ * The IANA media type of the file, if available from the provider.
2431
2485
  */
2432
- presencePenalty?: number;
2486
+ mediaType?: string;
2433
2487
  /**
2434
- * Frequency penalty setting. It affects the likelihood of the model
2435
- * to repeatedly use the same words or phrases.
2488
+ * The size of the file in bytes, if available from the provider.
2436
2489
  */
2437
- frequencyPenalty?: number;
2490
+ byteSize?: number;
2438
2491
  /**
2439
- * Response format. The output can either be text or JSON. Default is text.
2440
- *
2441
- * If JSON is selected, a schema can optionally be provided to guide the LLM.
2492
+ * When the file was created, if available from the provider.
2442
2493
  */
2443
- responseFormat?: {
2444
- type: 'text';
2445
- } | {
2446
- type: 'json';
2447
- /**
2448
- * JSON schema that the generated output should conform to.
2449
- */
2450
- schema?: JSONSchema7;
2451
- /**
2452
- * Name of output that should be generated. Used by some providers for additional LLM guidance.
2453
- */
2454
- name?: string;
2455
- /**
2456
- * Description of the output that should be generated. Used by some providers for additional LLM guidance.
2457
- */
2458
- description?: string;
2459
- };
2494
+ createdAt?: Date;
2460
2495
  /**
2461
- * The seed (integer) to use for random sampling. If set and supported
2462
- * by the model, calls will generate deterministic results.
2496
+ * When the provider will delete the file (retention expiry),
2497
+ * if available from the provider.
2463
2498
  */
2464
- seed?: number;
2499
+ expiresAt?: Date;
2500
+ /**
2501
+ * Additional provider-specific metadata. They are passed through
2502
+ * to the provider from the AI SDK and enable provider-specific
2503
+ * functionality that can be fully encapsulated in the provider.
2504
+ */
2505
+ providerMetadata?: SharedV4ProviderMetadata;
2506
+ /**
2507
+ * Warnings from the provider.
2508
+ */
2509
+ warnings: Array<SharedV4Warning>;
2510
+ };
2511
+
2512
+ /**
2513
+ * File data variant containing a byte stream. Providers that support
2514
+ * streaming uploads send it without buffering the full file in memory.
2515
+ */
2516
+ interface FilesV4UploadFileStreamData {
2517
+ type: 'stream';
2518
+ stream: ReadableStream<Uint8Array>;
2519
+ }
2520
+ /**
2521
+ * Options for uploading a file via the files interface.
2522
+ */
2523
+ type FilesV4UploadFileCallOptions = {
2465
2524
  /**
2466
- * The tools that are available for the model.
2525
+ * The file data.
2526
+ *
2527
+ * - `{ type: 'data', data }`: raw bytes (`Uint8Array`) or a base64-encoded string.
2528
+ * - `{ type: 'text', text }`: inline text (UTF-8).
2529
+ * - `{ type: 'stream', stream }`: a byte stream (not buffered by providers
2530
+ * that support streaming uploads).
2467
2531
  */
2468
- tools?: Array<LanguageModelV4FunctionTool | LanguageModelV4ProviderTool>;
2532
+ data: SharedV4FileDataData | SharedV4FileDataText | FilesV4UploadFileStreamData;
2469
2533
  /**
2470
- * Specifies how the tool should be selected. Defaults to 'auto'.
2534
+ * The IANA media type of the file (e.g. `'application/pdf'`).
2471
2535
  */
2472
- toolChoice?: LanguageModelV4ToolChoice;
2536
+ mediaType: string;
2473
2537
  /**
2474
- * Include raw chunks in the stream. Only applicable for streaming calls.
2538
+ * The filename of the file.
2475
2539
  */
2476
- includeRawChunks?: boolean;
2540
+ filename?: string;
2477
2541
  /**
2478
2542
  * Abort signal for cancelling the operation.
2479
2543
  */
@@ -2483,11 +2547,6 @@ type LanguageModelV4CallOptions = {
2483
2547
  * Only applicable for HTTP-based providers.
2484
2548
  */
2485
2549
  headers?: Record<string, string | undefined>;
2486
- /**
2487
- * Reasoning effort level for the model. Controls how much reasoning
2488
- * the model performs before generating a response. Defaults to 'provider-default'.
2489
- */
2490
- reasoning?: 'provider-default' | 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh';
2491
2550
  /**
2492
2551
  * Additional provider-specific options. They are passed through
2493
2552
  * to the provider from the AI SDK and enable provider-specific
@@ -2497,404 +2556,560 @@ type LanguageModelV4CallOptions = {
2497
2556
  };
2498
2557
 
2499
2558
  /**
2500
- * A provider-specific content block that does not map to another standardized
2501
- * content part type.
2559
+ * Result of uploading a file via the files interface.
2502
2560
  */
2503
- type LanguageModelV4CustomContent = {
2504
- type: 'custom';
2561
+ type FilesV4UploadFileResult = {
2505
2562
  /**
2506
- * The kind of custom content, in the format `{provider}.{provider-type}`.
2563
+ * A provider reference mapping provider names to provider-specific file identifiers.
2564
+ * The key is the canonical provider name (e.g. `openai`) and may differ from
2565
+ * the interface's `provider` id (e.g. `openai.files`).
2507
2566
  */
2508
- kind: `${string}.${string}`;
2567
+ providerReference: SharedV4ProviderReference;
2509
2568
  /**
2510
- * Additional provider-specific options. They are passed through
2569
+ * The IANA media type of the uploaded file, if available from the provider.
2570
+ */
2571
+ mediaType?: string;
2572
+ /**
2573
+ * The filename of the uploaded file, if available from the provider.
2574
+ */
2575
+ filename?: string;
2576
+ /**
2577
+ * The size of the uploaded file in bytes, if available from the provider.
2578
+ */
2579
+ byteSize?: number;
2580
+ /**
2581
+ * When the file was created, if available from the provider.
2582
+ */
2583
+ createdAt?: Date;
2584
+ /**
2585
+ * When the provider will delete the file (retention expiry, e.g. from a
2586
+ * requested upload TTL), if available from the provider.
2587
+ */
2588
+ expiresAt?: Date;
2589
+ /**
2590
+ * Additional provider-specific metadata. They are passed through
2511
2591
  * to the provider from the AI SDK and enable provider-specific
2512
2592
  * functionality that can be fully encapsulated in the provider.
2513
2593
  */
2514
2594
  providerMetadata?: SharedV4ProviderMetadata;
2595
+ /**
2596
+ * Warnings from the provider.
2597
+ */
2598
+ warnings: Array<SharedV4Warning>;
2515
2599
  };
2516
2600
 
2517
2601
  /**
2518
- * A file that has been generated by the model.
2519
- * Generated files as base64 encoded strings or binary data.
2520
- * The files should be returned without any unnecessary conversion.
2602
+ * Specification for a file management interface that implements the files interface version 4.
2603
+ *
2604
+ * Only `uploadFile` is required. The other operations are optional
2605
+ * capabilities: their presence signals that the provider supports them
2606
+ * (mirroring the optional-method pattern of `VideoModelV4`).
2521
2607
  */
2522
- type LanguageModelV4File = {
2523
- type: 'file';
2608
+ type FilesV4 = {
2524
2609
  /**
2525
- * The IANA media type of the file, e.g. `image/png` or `audio/mp3`.
2526
- *
2527
- * @see https://www.iana.org/assignments/media-types/media-types.xhtml
2610
+ * The files interface must specify which files interface version it implements.
2528
2611
  */
2529
- mediaType: string;
2612
+ readonly specificationVersion: 'v4';
2530
2613
  /**
2531
- * Generated file data as a tagged discriminated union:
2532
- *
2533
- * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
2534
- * - `{ type: 'url', url }`: a URL that points to the file.
2535
- *
2536
- * The file data should be returned without any unnecessary conversion.
2537
- * If the API returns base64 encoded strings, the file data should be returned
2538
- * as base64 encoded strings. If the API returns binary data, the file data should
2539
- * be returned as binary data.
2614
+ * Provider ID.
2540
2615
  */
2541
- data: SharedV4FileDataData | SharedV4FileDataUrl;
2616
+ readonly provider: string;
2542
2617
  /**
2543
- * Optional provider-specific metadata for the file part.
2618
+ * Uploads a file to the provider and returns a provider reference
2619
+ * that can be used in subsequent API calls.
2544
2620
  */
2545
- providerMetadata?: SharedV4ProviderMetadata;
2621
+ uploadFile(options: FilesV4UploadFileCallOptions): PromiseLike<FilesV4UploadFileResult>;
2622
+ /**
2623
+ * Retrieves metadata for a previously uploaded file.
2624
+ * Optional: presence signals that the provider supports metadata reads.
2625
+ */
2626
+ getFileMetadata?(options: FilesV4GetFileMetadataCallOptions): PromiseLike<FilesV4GetFileMetadataResult>;
2627
+ /**
2628
+ * Downloads the content of a previously uploaded file as a byte stream.
2629
+ * Optional: presence signals that the provider supports content download.
2630
+ */
2631
+ downloadFile?(options: FilesV4DownloadFileCallOptions): PromiseLike<FilesV4DownloadFileResult>;
2632
+ /**
2633
+ * Deletes a previously uploaded file.
2634
+ * Optional: presence signals that the provider supports deletion.
2635
+ */
2636
+ deleteFile?(options: FilesV4DeleteFileCallOptions): PromiseLike<FilesV4DeleteFileResult>;
2546
2637
  };
2547
2638
 
2548
2639
  /**
2549
- * Reasoning that the model has generated.
2640
+ * Usage information for an image model call.
2550
2641
  */
2551
- type LanguageModelV4Reasoning = {
2552
- type: 'reasoning';
2553
- text: string;
2642
+ type ImageModelV3Usage = {
2554
2643
  /**
2555
- * Optional provider-specific metadata for the reasoning part.
2644
+ * The number of input (prompt) tokens used.
2556
2645
  */
2557
- providerMetadata?: SharedV4ProviderMetadata;
2646
+ inputTokens: number | undefined;
2647
+ /**
2648
+ * The number of output tokens used, if reported by the provider.
2649
+ */
2650
+ outputTokens: number | undefined;
2651
+ /**
2652
+ * The total number of tokens as reported by the provider.
2653
+ */
2654
+ totalTokens: number | undefined;
2558
2655
  };
2559
2656
 
2560
2657
  /**
2561
- * A file that has been generated by the model as part of reasoning.
2562
- * Generated files as base64 encoded strings or binary data.
2563
- * The files should be returned without any unnecessary conversion.
2658
+ * An image file that can be used for image editing or variation generation.
2564
2659
  */
2565
- type LanguageModelV4ReasoningFile = {
2566
- type: 'reasoning-file';
2660
+ type ImageModelV3File = {
2661
+ type: 'file';
2567
2662
  /**
2568
- * The IANA media type of the file, e.g. `image/png` or `audio/mp3`.
2663
+ * The IANA media type of the file, e.g. `image/png`. Any string is supported.
2569
2664
  *
2570
2665
  * @see https://www.iana.org/assignments/media-types/media-types.xhtml
2571
2666
  */
2572
2667
  mediaType: string;
2573
2668
  /**
2574
- * Generated file data as a tagged discriminated union:
2575
- *
2576
- * - `{ type: 'data', data }`: raw bytes (Uint8Array) or base64-encoded string.
2577
- * - `{ type: 'url', url }`: a URL that points to the file.
2669
+ * Generated file data as base64 encoded strings or binary data.
2578
2670
  *
2579
2671
  * The file data should be returned without any unnecessary conversion.
2580
2672
  * If the API returns base64 encoded strings, the file data should be returned
2581
2673
  * as base64 encoded strings. If the API returns binary data, the file data should
2582
2674
  * be returned as binary data.
2583
2675
  */
2584
- data: SharedV4FileDataData | SharedV4FileDataUrl;
2676
+ data: string | Uint8Array;
2585
2677
  /**
2586
- * Optional provider-specific metadata for the reasoning file part.
2678
+ * Optional provider-specific metadata for the file part.
2587
2679
  */
2588
- providerMetadata?: SharedV4ProviderMetadata;
2680
+ providerOptions?: SharedV3ProviderMetadata;
2681
+ } | {
2682
+ type: 'url';
2683
+ /**
2684
+ * The URL of the image file.
2685
+ */
2686
+ url: string;
2687
+ /**
2688
+ * Optional provider-specific metadata for the file part.
2689
+ */
2690
+ providerOptions?: SharedV3ProviderMetadata;
2589
2691
  };
2590
2692
 
2591
- /**
2592
- * A source that has been used as input to generate the response.
2593
- */
2594
- type LanguageModelV4Source = {
2595
- type: 'source';
2693
+ type ImageModelV3CallOptions = {
2596
2694
  /**
2597
- * The type of source - URL sources reference web content.
2695
+ * Prompt for the image generation. Some operations, like upscaling, may not require a prompt.
2598
2696
  */
2599
- sourceType: 'url';
2697
+ prompt: string | undefined;
2600
2698
  /**
2601
- * The ID of the source.
2699
+ * Number of images to generate.
2602
2700
  */
2603
- id: string;
2701
+ n: number;
2604
2702
  /**
2605
- * The URL of the source.
2703
+ * Size of the images to generate.
2704
+ * Must have the format `{width}x{height}`.
2705
+ * `undefined` will use the provider's default size.
2606
2706
  */
2607
- url: string;
2707
+ size: `${number}x${number}` | undefined;
2608
2708
  /**
2609
- * The title of the source.
2709
+ * Aspect ratio of the images to generate.
2710
+ * Must have the format `{width}:{height}`.
2711
+ * `undefined` will use the provider's default aspect ratio.
2610
2712
  */
2611
- title?: string;
2713
+ aspectRatio: `${number}:${number}` | undefined;
2612
2714
  /**
2613
- * Additional provider metadata for the source.
2715
+ * Seed for the image generation.
2716
+ * `undefined` will use the provider's default seed.
2614
2717
  */
2615
- providerMetadata?: SharedV4ProviderMetadata;
2616
- } | {
2617
- type: 'source';
2718
+ seed: number | undefined;
2618
2719
  /**
2619
- * The type of source - document sources reference files/documents.
2720
+ * Array of images for image editing or variation generation.
2721
+ * The images should be provided as base64 encoded strings or binary data.
2620
2722
  */
2621
- sourceType: 'document';
2723
+ files: ImageModelV3File[] | undefined;
2622
2724
  /**
2623
- * The ID of the source.
2725
+ * Mask image for inpainting operations.
2726
+ * The mask should be provided as base64 encoded strings or binary data.
2624
2727
  */
2625
- id: string;
2728
+ mask: ImageModelV3File | undefined;
2626
2729
  /**
2627
- * IANA media type of the document (e.g., 'application/pdf').
2730
+ * Additional provider-specific options that are passed through to the provider
2731
+ * as body parameters.
2732
+ *
2733
+ * The outer record is keyed by the provider name, and the inner
2734
+ * record is keyed by the provider-specific metadata key.
2735
+ *
2736
+ * ```ts
2737
+ * {
2738
+ * "openai": {
2739
+ * "style": "vivid"
2740
+ * }
2741
+ * }
2742
+ * ```
2743
+ */
2744
+ providerOptions: SharedV3ProviderOptions;
2745
+ /**
2746
+ * Abort signal for cancelling the operation.
2747
+ */
2748
+ abortSignal?: AbortSignal;
2749
+ /**
2750
+ * Additional HTTP headers to be sent with the request.
2751
+ * Only applicable for HTTP-based providers.
2752
+ */
2753
+ headers?: Record<string, string | undefined>;
2754
+ };
2755
+
2756
+ type ImageModelV3ProviderMetadata = Record<string, {
2757
+ images: JSONArray;
2758
+ } & JSONValue>;
2759
+ type GetMaxImagesPerCallFunction$1 = (options: {
2760
+ modelId: string;
2761
+ }) => PromiseLike<number | undefined> | number | undefined;
2762
+ /**
2763
+ * Image generation model specification version 3.
2764
+ */
2765
+ type ImageModelV3 = {
2766
+ /**
2767
+ * The image model must specify which image model interface
2768
+ * version it implements. This will allow us to evolve the image
2769
+ * model interface and retain backwards compatibility. The different
2770
+ * implementation versions can be handled as a discriminated union
2771
+ * on our side.
2628
2772
  */
2629
- mediaType: string;
2773
+ readonly specificationVersion: 'v3';
2630
2774
  /**
2631
- * The title of the document.
2775
+ * Name of the provider for logging purposes.
2632
2776
  */
2633
- title: string;
2777
+ readonly provider: string;
2634
2778
  /**
2635
- * Optional filename of the document.
2779
+ * Provider-specific model ID for logging purposes.
2636
2780
  */
2637
- filename?: string;
2781
+ readonly modelId: string;
2638
2782
  /**
2639
- * Additional provider metadata for the source.
2783
+ * Limit of how many images can be generated in a single API call.
2784
+ * Can be set to a number for a fixed limit, to undefined to use
2785
+ * the global limit, or a function that returns a number or undefined,
2786
+ * optionally as a promise.
2640
2787
  */
2641
- providerMetadata?: SharedV4ProviderMetadata;
2642
- };
2643
-
2644
- /**
2645
- * Text that the model has generated.
2646
- */
2647
- type LanguageModelV4Text = {
2648
- type: 'text';
2788
+ readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction$1;
2649
2789
  /**
2650
- * The text content.
2790
+ * Generates an array of images.
2651
2791
  */
2652
- text: string;
2653
- providerMetadata?: SharedV4ProviderMetadata;
2792
+ doGenerate(options: ImageModelV3CallOptions): PromiseLike<{
2793
+ /**
2794
+ * Generated images as base64 encoded strings or binary data.
2795
+ * The images should be returned without any unnecessary conversion.
2796
+ * If the API returns base64 encoded strings, the images should be returned
2797
+ * as base64 encoded strings. If the API returns binary data, the images should
2798
+ * be returned as binary data.
2799
+ */
2800
+ images: Array<string> | Array<Uint8Array>;
2801
+ /**
2802
+ * Warnings for the call, e.g. unsupported features.
2803
+ */
2804
+ warnings: Array<SharedV3Warning>;
2805
+ /**
2806
+ * Additional provider-specific metadata. They are passed through
2807
+ * from the provider to the AI SDK and enable provider-specific
2808
+ * results that can be fully encapsulated in the provider.
2809
+ *
2810
+ * The outer record is keyed by the provider name, and the inner
2811
+ * record is provider-specific metadata. It always includes an
2812
+ * `images` key with image-specific metadata
2813
+ *
2814
+ * ```ts
2815
+ * {
2816
+ * "openai": {
2817
+ * "images": ["revisedPrompt": "Revised prompt here."]
2818
+ * }
2819
+ * }
2820
+ * ```
2821
+ */
2822
+ providerMetadata?: ImageModelV3ProviderMetadata;
2823
+ /**
2824
+ * Response information for telemetry and debugging purposes.
2825
+ */
2826
+ response: {
2827
+ /**
2828
+ * Timestamp for the start of the generated response.
2829
+ */
2830
+ timestamp: Date;
2831
+ /**
2832
+ * The ID of the response model that was used to generate the response.
2833
+ */
2834
+ modelId: string;
2835
+ /**
2836
+ * Response headers.
2837
+ */
2838
+ headers: Record<string, string> | undefined;
2839
+ };
2840
+ /**
2841
+ * Optional token usage for the image generation call (if the provider reports it).
2842
+ */
2843
+ usage?: ImageModelV3Usage;
2844
+ }>;
2654
2845
  };
2655
2846
 
2656
- /**
2657
- * Tool approval request emitted by a provider for a provider-executed tool call.
2658
- *
2659
- * This is used for flows where the provider executes the tool (e.g. MCP tools)
2660
- * but requires an explicit user approval before continuing.
2661
- */
2662
- type LanguageModelV4ToolApprovalRequest = {
2663
- type: 'tool-approval-request';
2664
- /**
2665
- * ID of the approval request. This ID is referenced by the subsequent
2666
- * tool-approval-response (tool message) to approve or deny execution.
2667
- */
2668
- approvalId: string;
2847
+ type ImageModelV2CallOptions = {
2669
2848
  /**
2670
- * The tool call ID that this approval request is for.
2849
+ * Prompt for the image generation.
2671
2850
  */
2672
- toolCallId: string;
2851
+ prompt: string;
2673
2852
  /**
2674
- * Additional provider-specific metadata for the approval request.
2853
+ * Number of images to generate.
2675
2854
  */
2676
- providerMetadata?: SharedV4ProviderMetadata;
2677
- };
2678
-
2679
- /**
2680
- * Tool calls that the model has generated.
2681
- */
2682
- type LanguageModelV4ToolCall = {
2683
- type: 'tool-call';
2855
+ n: number;
2684
2856
  /**
2685
- * The identifier of the tool call. It must be unique across all tool calls.
2857
+ * Size of the images to generate.
2858
+ * Must have the format `{width}x{height}`.
2859
+ * `undefined` will use the provider's default size.
2686
2860
  */
2687
- toolCallId: string;
2861
+ size: `${number}x${number}` | undefined;
2688
2862
  /**
2689
- * The name of the tool that should be called.
2863
+ * Aspect ratio of the images to generate.
2864
+ * Must have the format `{width}:{height}`.
2865
+ * `undefined` will use the provider's default aspect ratio.
2690
2866
  */
2691
- toolName: string;
2867
+ aspectRatio: `${number}:${number}` | undefined;
2692
2868
  /**
2693
- * Stringified JSON object with the tool call arguments. Must match the
2694
- * parameters schema of the tool.
2869
+ * Seed for the image generation.
2870
+ * `undefined` will use the provider's default seed.
2695
2871
  */
2696
- input: string;
2872
+ seed: number | undefined;
2697
2873
  /**
2698
- * Whether the tool call will be executed by the provider.
2699
- * If this flag is not set or is false, the tool call will be executed by the client.
2874
+ * Additional provider-specific options that are passed through to the provider
2875
+ * as body parameters.
2876
+ *
2877
+ * The outer record is keyed by the provider name, and the inner
2878
+ * record is keyed by the provider-specific metadata key.
2879
+ * ```ts
2880
+ * {
2881
+ * "openai": {
2882
+ * "style": "vivid"
2883
+ * }
2884
+ * }
2885
+ * ```
2700
2886
  */
2701
- providerExecuted?: boolean;
2887
+ providerOptions: SharedV2ProviderOptions;
2702
2888
  /**
2703
- * Whether the tool is dynamic, i.e. defined at runtime.
2704
- * For example, MCP (Model Context Protocol) tools that are executed by the provider.
2889
+ * Abort signal for cancelling the operation.
2705
2890
  */
2706
- dynamic?: boolean;
2891
+ abortSignal?: AbortSignal;
2707
2892
  /**
2708
- * Additional provider-specific metadata for the tool call.
2893
+ * Additional HTTP headers to be sent with the request.
2894
+ * Only applicable for HTTP-based providers.
2709
2895
  */
2710
- providerMetadata?: SharedV4ProviderMetadata;
2896
+ headers?: Record<string, string | undefined>;
2711
2897
  };
2712
2898
 
2713
2899
  /**
2714
- * Result of a tool call that has been executed by the provider.
2900
+ * Warning from the model provider for this call. The call will proceed, but e.g.
2901
+ * some settings might not be supported, which can lead to suboptimal results.
2715
2902
  */
2716
- type LanguageModelV4ToolResult = {
2717
- type: 'tool-result';
2718
- /**
2719
- * The ID of the tool call that this result is associated with.
2720
- */
2721
- toolCallId: string;
2722
- /**
2723
- * Name of the tool that generated this result.
2724
- */
2725
- toolName: string;
2903
+ type ImageModelV2CallWarning = {
2904
+ type: 'unsupported-setting';
2905
+ setting: keyof ImageModelV2CallOptions;
2906
+ details?: string;
2907
+ } | {
2908
+ type: 'other';
2909
+ message: string;
2910
+ };
2911
+
2912
+ type ImageModelV2ProviderMetadata = Record<string, {
2913
+ images: JSONArray;
2914
+ } & JSONValue>;
2915
+ type GetMaxImagesPerCallFunction = (options: {
2916
+ modelId: string;
2917
+ }) => PromiseLike<number | undefined> | number | undefined;
2918
+ /**
2919
+ * Image generation model specification version 2.
2920
+ */
2921
+ type ImageModelV2 = {
2726
2922
  /**
2727
- * Result of the tool call. This is a JSON-serializable object.
2923
+ * The image model must specify which image model interface
2924
+ * version it implements. This will allow us to evolve the image
2925
+ * model interface and retain backwards compatibility. The different
2926
+ * implementation versions can be handled as a discriminated union
2927
+ * on our side.
2728
2928
  */
2729
- result: NonNullable<JSONValue>;
2929
+ readonly specificationVersion: 'v2';
2730
2930
  /**
2731
- * Optional flag if the result is an error or an error message.
2931
+ * Name of the provider for logging purposes.
2732
2932
  */
2733
- isError?: boolean;
2933
+ readonly provider: string;
2734
2934
  /**
2735
- * Whether the tool result is preliminary.
2736
- *
2737
- * Preliminary tool results replace each other, e.g. image previews.
2738
- * There always has to be a final, non-preliminary tool result.
2739
- *
2740
- * If this flag is set to true, the tool result is preliminary.
2741
- * If this flag is not set or is false, the tool result is not preliminary.
2935
+ * Provider-specific model ID for logging purposes.
2742
2936
  */
2743
- preliminary?: boolean;
2937
+ readonly modelId: string;
2744
2938
  /**
2745
- * Whether the tool is dynamic, i.e. defined at runtime.
2746
- * For example, MCP (Model Context Protocol) tools that are executed by the provider.
2939
+ * Limit of how many images can be generated in a single API call.
2940
+ * Can be set to a number for a fixed limit, to undefined to use
2941
+ * the global limit, or a function that returns a number or undefined,
2942
+ * optionally as a promise.
2747
2943
  */
2748
- dynamic?: boolean;
2944
+ readonly maxImagesPerCall: number | undefined | GetMaxImagesPerCallFunction;
2749
2945
  /**
2750
- * Additional provider-specific metadata for the tool result.
2946
+ * Generates an array of images.
2751
2947
  */
2752
- providerMetadata?: SharedV4ProviderMetadata;
2948
+ doGenerate(options: ImageModelV2CallOptions): PromiseLike<{
2949
+ /**
2950
+ * Generated images as base64 encoded strings or binary data.
2951
+ * The images should be returned without any unnecessary conversion.
2952
+ * If the API returns base64 encoded strings, the images should be returned
2953
+ * as base64 encoded strings. If the API returns binary data, the images should
2954
+ * be returned as binary data.
2955
+ */
2956
+ images: Array<string> | Array<Uint8Array>;
2957
+ /**
2958
+ * Warnings for the call, e.g. unsupported settings.
2959
+ */
2960
+ warnings: Array<ImageModelV2CallWarning>;
2961
+ /**
2962
+ * Additional provider-specific metadata. They are passed through
2963
+ * from the provider to the AI SDK and enable provider-specific
2964
+ * results that can be fully encapsulated in the provider.
2965
+ *
2966
+ * The outer record is keyed by the provider name, and the inner
2967
+ * record is provider-specific metadata. It always includes an
2968
+ * `images` key with image-specific metadata
2969
+ *
2970
+ * ```ts
2971
+ * {
2972
+ * "openai": {
2973
+ * "images": ["revisedPrompt": "Revised prompt here."]
2974
+ * }
2975
+ * }
2976
+ * ```
2977
+ */
2978
+ providerMetadata?: ImageModelV2ProviderMetadata;
2979
+ /**
2980
+ * Response information for telemetry and debugging purposes.
2981
+ */
2982
+ response: {
2983
+ /**
2984
+ * Timestamp for the start of the generated response.
2985
+ */
2986
+ timestamp: Date;
2987
+ /**
2988
+ * The ID of the response model that was used to generate the response.
2989
+ */
2990
+ modelId: string;
2991
+ /**
2992
+ * Response headers.
2993
+ */
2994
+ headers: Record<string, string> | undefined;
2995
+ };
2996
+ }>;
2753
2997
  };
2754
2998
 
2755
- type LanguageModelV4Content = LanguageModelV4Text | LanguageModelV4Reasoning | LanguageModelV4CustomContent | LanguageModelV4ReasoningFile | LanguageModelV4File | LanguageModelV4ToolApprovalRequest | LanguageModelV4Source | LanguageModelV4ToolCall | LanguageModelV4ToolResult;
2756
-
2757
2999
  /**
2758
- * Reason why a language model finished generating a response.
2759
- *
2760
- * Contains both a unified finish reason and a raw finish reason from the provider.
2761
- * The unified finish reason is used to provide a consistent finish reason across different providers.
2762
- * The raw finish reason is used to provide the original finish reason from the provider.
3000
+ * Middleware for ImageModelV4.
3001
+ * This type defines the structure for middleware that can be used to modify
3002
+ * the behavior of ImageModelV4 operations.
2763
3003
  */
2764
- type LanguageModelV4FinishReason = {
2765
- /**
2766
- * Unified finish reason. This enables using the same finish reason across different providers.
2767
- *
2768
- * Can be one of the following:
2769
- * - `stop`: model generated stop sequence
2770
- * - `length`: model generated maximum number of tokens
2771
- * - `content-filter`: content filter violation stopped the model
2772
- * - `tool-calls`: model triggered tool calls
2773
- * - `error`: model stopped because of an error
2774
- * - `other`: model stopped for other reasons
2775
- */
2776
- unified: 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
2777
- /**
2778
- * Raw finish reason from the provider.
2779
- * This is the original finish reason from the provider.
2780
- */
2781
- raw: string | undefined;
2782
- };
2783
-
2784
- interface LanguageModelV4ResponseMetadata {
3004
+ type ImageModelV4Middleware = {
2785
3005
  /**
2786
- * ID for the generated response, if the provider sends one.
3006
+ * Middleware specification version. Use `v4` for the current version.
2787
3007
  */
2788
- id?: string;
3008
+ readonly specificationVersion: 'v4';
2789
3009
  /**
2790
- * Timestamp for the start of the generated response, if the provider sends one.
3010
+ * Override the provider name if desired.
3011
+ * @param options.model - The image model instance.
2791
3012
  */
2792
- timestamp?: Date;
3013
+ overrideProvider?: (options: {
3014
+ model: ImageModelV4;
3015
+ }) => string;
2793
3016
  /**
2794
- * The ID of the response model that was used to generate the response, if the provider sends one.
3017
+ * Override the model ID if desired.
3018
+ * @param options.model - The image model instance.
2795
3019
  */
2796
- modelId?: string;
2797
- }
2798
-
2799
- /**
2800
- * Usage information for a language model call.
2801
- */
2802
- type LanguageModelV4Usage = {
3020
+ overrideModelId?: (options: {
3021
+ model: ImageModelV4;
3022
+ }) => string;
2803
3023
  /**
2804
- * Information about the input tokens.
3024
+ * Override the limit of how many images can be generated in a single API call if desired.
3025
+ * @param options.model - The image model instance.
2805
3026
  */
2806
- inputTokens: {
2807
- /**
2808
- * The total number of input (prompt) tokens used.
2809
- */
2810
- total: number | undefined;
2811
- /**
2812
- * The number of non-cached input (prompt) tokens used.
2813
- */
2814
- noCache: number | undefined;
2815
- /**
2816
- * The number of cached input (prompt) tokens read.
2817
- */
2818
- cacheRead: number | undefined;
2819
- /**
2820
- * The number of cached input (prompt) tokens written.
2821
- */
2822
- cacheWrite: number | undefined;
2823
- };
3027
+ overrideMaxImagesPerCall?: (options: {
3028
+ model: ImageModelV4;
3029
+ }) => ImageModelV4['maxImagesPerCall'];
2824
3030
  /**
2825
- * Information about the output tokens.
3031
+ * Transforms the parameters before they are passed to the image model.
3032
+ * @param options - Object containing the parameters.
3033
+ * @param options.params - The original parameters for the image model call.
3034
+ * @returns A promise that resolves to the transformed parameters.
2826
3035
  */
2827
- outputTokens: {
2828
- /**
2829
- * The total number of output (completion) tokens used.
2830
- */
2831
- total: number | undefined;
2832
- /**
2833
- * The number of text tokens used.
2834
- */
2835
- text: number | undefined;
2836
- /**
2837
- * The number of reasoning tokens used.
2838
- */
2839
- reasoning: number | undefined;
2840
- };
3036
+ transformParams?: (options: {
3037
+ params: ImageModelV4CallOptions;
3038
+ model: ImageModelV4;
3039
+ }) => PromiseLike<ImageModelV4CallOptions>;
2841
3040
  /**
2842
- * Raw usage information from the provider.
3041
+ * Wraps the generate operation of the image model.
2843
3042
  *
2844
- * This is the usage information in the shape that the provider returns.
2845
- * It can include additional information that is not part of the standard usage information.
3043
+ * @param options - Object containing the generate function, parameters, and model.
3044
+ * @param options.doGenerate - The original generate function.
3045
+ * @param options.params - The parameters for the generate call. If the
3046
+ * `transformParams` middleware is used, this will be the transformed parameters.
3047
+ * @param options.model - The image model instance.
3048
+ * @returns A promise that resolves to the result of the generate operation.
2846
3049
  */
2847
- raw?: JSONObject;
3050
+ wrapGenerate?: (options: {
3051
+ doGenerate: () => ReturnType<ImageModelV4['doGenerate']>;
3052
+ params: ImageModelV4CallOptions;
3053
+ model: ImageModelV4;
3054
+ }) => Promise<Awaited<ReturnType<ImageModelV4['doGenerate']>>>;
2848
3055
  };
2849
3056
 
2850
3057
  /**
2851
- * The result of a language model doGenerate call.
3058
+ * Middleware for ImageModelV3.
3059
+ * This type defines the structure for middleware that can be used to modify
3060
+ * the behavior of ImageModelV3 operations.
2852
3061
  */
2853
- type LanguageModelV4GenerateResult = {
2854
- /**
2855
- * Ordered content that the model has generated.
2856
- */
2857
- content: Array<LanguageModelV4Content>;
3062
+ type ImageModelV3Middleware = {
2858
3063
  /**
2859
- * The finish reason.
3064
+ * Middleware specification version. Use `v3` for the current version.
2860
3065
  */
2861
- finishReason: LanguageModelV4FinishReason;
3066
+ readonly specificationVersion: 'v3';
2862
3067
  /**
2863
- * The usage information.
3068
+ * Override the provider name if desired.
3069
+ * @param options.model - The image model instance.
2864
3070
  */
2865
- usage: LanguageModelV4Usage;
3071
+ overrideProvider?: (options: {
3072
+ model: ImageModelV3;
3073
+ }) => string;
2866
3074
  /**
2867
- * Additional provider-specific metadata. They are passed through
2868
- * from the provider to the AI SDK and enable provider-specific
2869
- * results that can be fully encapsulated in the provider.
3075
+ * Override the model ID if desired.
3076
+ * @param options.model - The image model instance.
2870
3077
  */
2871
- providerMetadata?: SharedV4ProviderMetadata;
3078
+ overrideModelId?: (options: {
3079
+ model: ImageModelV3;
3080
+ }) => string;
2872
3081
  /**
2873
- * Optional request information for telemetry and debugging purposes.
3082
+ * Override the limit of how many images can be generated in a single API call if desired.
3083
+ * @param options.model - The image model instance.
2874
3084
  */
2875
- request?: {
2876
- /**
2877
- * Request HTTP body that was sent to the provider API.
2878
- */
2879
- body?: unknown;
2880
- };
3085
+ overrideMaxImagesPerCall?: (options: {
3086
+ model: ImageModelV3;
3087
+ }) => ImageModelV3['maxImagesPerCall'];
2881
3088
  /**
2882
- * Optional response information for telemetry and debugging purposes.
3089
+ * Transforms the parameters before they are passed to the image model.
3090
+ * @param options - Object containing the parameters.
3091
+ * @param options.params - The original parameters for the image model call.
3092
+ * @returns A promise that resolves to the transformed parameters.
2883
3093
  */
2884
- response?: LanguageModelV4ResponseMetadata & {
2885
- /**
2886
- * Response headers.
2887
- */
2888
- headers?: SharedV4Headers;
2889
- /**
2890
- * Response HTTP body.
2891
- */
2892
- body?: unknown;
2893
- };
3094
+ transformParams?: (options: {
3095
+ params: ImageModelV3CallOptions;
3096
+ model: ImageModelV3;
3097
+ }) => PromiseLike<ImageModelV3CallOptions>;
2894
3098
  /**
2895
- * Warnings for the call, e.g. unsupported settings.
3099
+ * Wraps the generate operation of the image model.
3100
+ *
3101
+ * @param options - Object containing the generate function, parameters, and model.
3102
+ * @param options.doGenerate - The original generate function.
3103
+ * @param options.params - The parameters for the generate call. If the
3104
+ * `transformParams` middleware is used, this will be the transformed parameters.
3105
+ * @param options.model - The image model instance.
3106
+ * @returns A promise that resolves to the result of the generate operation.
2896
3107
  */
2897
- warnings: Array<SharedV4Warning>;
3108
+ wrapGenerate?: (options: {
3109
+ doGenerate: () => ReturnType<ImageModelV3['doGenerate']>;
3110
+ params: ImageModelV3CallOptions;
3111
+ model: ImageModelV3;
3112
+ }) => Promise<Awaited<ReturnType<ImageModelV3['doGenerate']>>>;
2898
3113
  };
2899
3114
 
2900
3115
  type LanguageModelV4StreamPart = {
@@ -5164,25 +5379,6 @@ type EmbeddingModelV3Middleware = {
5164
5379
  }) => Promise<Awaited<ReturnType<EmbeddingModelV3['doEmbed']>>>;
5165
5380
  };
5166
5381
 
5167
- /**
5168
- * A normalized language model call within a batch.
5169
- */
5170
- type LanguageModelV4BatchRequest = {
5171
- /**
5172
- * Application-provided identifier used to correlate the request with its
5173
- * result.
5174
- */
5175
- readonly id: string;
5176
- /**
5177
- * Normalized text-generation options for the request.
5178
- */
5179
- readonly options: Pick<LanguageModelV4CallOptions, 'prompt' | 'maxOutputTokens' | 'temperature' | 'stopSequences' | 'topP' | 'topK' | 'presencePenalty' | 'frequencyPenalty' | 'seed' | 'reasoning' | 'responseFormat' | 'toolChoice' | 'tools' | 'providerOptions'>;
5180
- };
5181
- /**
5182
- * Language model V4 with durable batch-processing support.
5183
- */
5184
- type BatchLanguageModelV4 = LanguageModelV4 & BatchModelV4<LanguageModelV4BatchRequest, LanguageModelV4GenerateResult>;
5185
-
5186
5382
  type RerankingModelV4CallOptions = {
5187
5383
  /**
5188
5384
  * Documents to rerank.
@@ -6910,12 +7106,33 @@ type RealtimeModelV4FunctionCallOutput = {
6910
7106
  type RealtimeModelV4ClientEvent = {
6911
7107
  type: 'session-update';
6912
7108
  config: RealtimeModelV4SessionConfig;
7109
+ eventId?: string;
7110
+ } | {
7111
+ type: 'session-start';
7112
+ config: RealtimeModelV4SessionConfig;
7113
+ eventId?: string;
7114
+ } | {
7115
+ type: 'session-close';
7116
+ eventId?: string;
7117
+ } | {
7118
+ type: 'input-audio-mute';
7119
+ eventId?: string;
7120
+ } | {
7121
+ type: 'input-audio-unmute';
7122
+ eventId?: string;
7123
+ } | {
7124
+ type: 'context-append';
7125
+ content: string;
7126
+ delegationId: string | null;
7127
+ eventId?: string;
7128
+ providerOptions?: SharedV4ProviderOptions;
6913
7129
  } | {
6914
7130
  type: 'input-audio-append';
6915
7131
  /**
6916
7132
  * Base64-encoded audio chunk to append to the input buffer.
6917
7133
  */
6918
7134
  audio: string;
7135
+ eventId?: string;
6919
7136
  } | {
6920
7137
  type: 'input-audio-commit';
6921
7138
  } | {
@@ -6956,6 +7173,51 @@ type RealtimeModelV4ClientEvent = {
6956
7173
  * event data for debugging and provider-specific access.
6957
7174
  */
6958
7175
  type RealtimeModelV4ServerEvent = {
7176
+ type: 'session-started';
7177
+ sessionId: string;
7178
+ delegationMode?: 'client' | 'provider';
7179
+ raw: unknown;
7180
+ } | {
7181
+ type: 'session-closed';
7182
+ sessionId?: string;
7183
+ usage: {
7184
+ seconds: number;
7185
+ };
7186
+ reason: string;
7187
+ raw: unknown;
7188
+ } | {
7189
+ type: 'session-usage';
7190
+ /** Cumulative duration snapshot, not an increment. */
7191
+ usage: {
7192
+ seconds: number;
7193
+ };
7194
+ contextWindowUsageRatio?: number;
7195
+ raw: unknown;
7196
+ } | {
7197
+ type: 'audio-chunk';
7198
+ delta: string;
7199
+ raw: unknown;
7200
+ } | {
7201
+ type: 'transcript-fragment';
7202
+ speaker: 'user' | 'assistant';
7203
+ delta: string;
7204
+ startMs: number;
7205
+ endMs: number;
7206
+ raw: unknown;
7207
+ } | {
7208
+ type: 'delegation-created';
7209
+ delegationId: string;
7210
+ target?: 'client' | 'provider';
7211
+ offsetMs?: number;
7212
+ responseId?: string;
7213
+ raw: unknown;
7214
+ } | {
7215
+ type: 'command-acknowledged';
7216
+ /** Provider-native command name that was acknowledged. */
7217
+ command: string;
7218
+ clientEventId?: string;
7219
+ raw: unknown;
7220
+ } | {
6959
7221
  type: 'session-created';
6960
7222
  sessionId?: string;
6961
7223
  raw: unknown;
@@ -7086,6 +7348,7 @@ type RealtimeModelV4ServerEvent = {
7086
7348
  type: 'error';
7087
7349
  message: string;
7088
7350
  code?: string;
7351
+ clientEventId?: string;
7089
7352
  raw: unknown;
7090
7353
  } | {
7091
7354
  type: 'custom';
@@ -7116,6 +7379,38 @@ type RealtimeModelV4 = {
7116
7379
  * Provider-specific model ID (e.g. 'gpt-4o-realtime', 'grok-3').
7117
7380
  */
7118
7381
  readonly modelId: string;
7382
+ /** Conversation semantics and supported transports, when declared. */
7383
+ readonly capabilities?: {
7384
+ conversation: 'continuous' | 'turn-based';
7385
+ transports: readonly ('websocket' | 'webrtc')[];
7386
+ /** Omission preserves the legacy client-secret WebSocket connection. */
7387
+ connections?: readonly ('client-secret-websocket' | 'server-websocket' | 'webrtc')[];
7388
+ /** Omission preserves session-update startup. WebRTC setup may start the session. */
7389
+ startup?: 'session-start' | 'session-update';
7390
+ /** Omission preserves transport-close finalization. */
7391
+ finalization?: 'session-close' | 'transport-close';
7392
+ };
7393
+ /** Server-only connection settings. Headers can contain long-lived credentials. */
7394
+ getServerWebSocketConfig?(): {
7395
+ url: string;
7396
+ headers: Record<string, string>;
7397
+ } | PromiseLike<{
7398
+ url: string;
7399
+ headers: Record<string, string>;
7400
+ }>;
7401
+ /** Provider-specific setup for the WebRTC event channel. */
7402
+ getWebRTCConfig?(): {
7403
+ dataChannelLabel: string;
7404
+ };
7405
+ /** Server-side SDP exchange. Return only the answer and session ID to the client. */
7406
+ doCreateWebRTCSession?(options: {
7407
+ sdp: string;
7408
+ sessionConfig?: RealtimeModelV4SessionConfig;
7409
+ abortSignal?: AbortSignal;
7410
+ }): PromiseLike<{
7411
+ sessionId: string;
7412
+ sdp: string;
7413
+ }>;
7119
7414
  /**
7120
7415
  * Server-side: Creates an ephemeral client secret for authenticating
7121
7416
  * browser-side WebSocket connections. The secret is short-lived and
@@ -7123,13 +7418,13 @@ type RealtimeModelV4 = {
7123
7418
  *
7124
7419
  * Naming: "do" prefix to prevent accidental direct usage by the user.
7125
7420
  */
7126
- doCreateClientSecret(options: RealtimeModelV4ClientSecretOptions): PromiseLike<RealtimeModelV4ClientSecretResult>;
7421
+ doCreateClientSecret?(options: RealtimeModelV4ClientSecretOptions): PromiseLike<RealtimeModelV4ClientSecretResult>;
7127
7422
  /**
7128
7423
  * Browser-side: Returns the WebSocket URL and subprotocols to use
7129
7424
  * when connecting. Each provider has its own authentication mechanism
7130
7425
  * (e.g. OpenAI uses subprotocol headers, xAI may use query params).
7131
7426
  */
7132
- getWebSocketConfig(options: {
7427
+ getWebSocketConfig?(options: {
7133
7428
  token: string;
7134
7429
  url: string;
7135
7430
  }): {
@@ -7146,6 +7441,8 @@ type RealtimeModelV4 = {
7146
7441
  * text, and turn-complete data in one message).
7147
7442
  */
7148
7443
  parseServerEvent(raw: unknown): RealtimeModelV4ServerEvent | RealtimeModelV4ServerEvent[];
7444
+ /** Create a raw-event parser per connection and discard it on disconnect. */
7445
+ createServerEventParser?(): (raw: unknown) => RealtimeModelV4ServerEvent | RealtimeModelV4ServerEvent[];
7149
7446
  /**
7150
7447
  * Browser-side: Serializes a normalized client event into the
7151
7448
  * provider's native JSON format for sending over the WebSocket.
@@ -8170,4 +8467,4 @@ type VideoModelV3 = {
8170
8467
  }>;
8171
8468
  };
8172
8469
 
8173
- export { AISDKError, APICallError, type EmbeddingModelV2, type EmbeddingModelV2Embedding, type EmbeddingModelV3, type EmbeddingModelV3CallOptions, type EmbeddingModelV3Embedding, type EmbeddingModelV3Middleware, type EmbeddingModelV3Result, type EmbeddingModelV4, type EmbeddingModelV4CallOptions, type EmbeddingModelV4Embedding, type EmbeddingModelV4Middleware, type EmbeddingModelV4Result, EmptyResponseBodyError, type BatchLanguageModelV4 as Experimental_BatchLanguageModelV4, type BatchModelV4 as Experimental_BatchModelV4, type BatchV4Error as Experimental_BatchV4Error, type BatchV4ItemResult as Experimental_BatchV4ItemResult, type BatchV4OperationOptions as Experimental_BatchV4OperationOptions, type BatchV4StartOptions as Experimental_BatchV4StartOptions, type BatchV4StartResult as Experimental_BatchV4StartResult, type BatchV4Status as Experimental_BatchV4Status, type LanguageModelV4BatchRequest as Experimental_LanguageModelV4BatchRequest, type RealtimeFactoryV4 as Experimental_RealtimeFactoryV4, type RealtimeFactoryV4GetTokenOptions as Experimental_RealtimeFactoryV4GetTokenOptions, type RealtimeFactoryV4GetTokenResult as Experimental_RealtimeFactoryV4GetTokenResult, type RealtimeModelV4 as Experimental_RealtimeModelV4, type RealtimeModelV4AudioMessage as Experimental_RealtimeModelV4AudioMessage, type RealtimeModelV4ClientEvent as Experimental_RealtimeModelV4ClientEvent, type RealtimeModelV4ClientSecretOptions as Experimental_RealtimeModelV4ClientSecretOptions, type RealtimeModelV4ClientSecretResult as Experimental_RealtimeModelV4ClientSecretResult, type RealtimeModelV4ConversationItem as Experimental_RealtimeModelV4ConversationItem, type RealtimeModelV4FunctionCallOutput as Experimental_RealtimeModelV4FunctionCallOutput, type RealtimeModelV4ServerEvent as Experimental_RealtimeModelV4ServerEvent, type RealtimeModelV4SessionConfig as Experimental_RealtimeModelV4SessionConfig, type RealtimeModelV4TextMessage as Experimental_RealtimeModelV4TextMessage, type RealtimeModelV4ToolDefinition as Experimental_RealtimeModelV4ToolDefinition, type SpeechTranslationModelV4 as Experimental_SpeechTranslationModelV4, type SpeechTranslationModelV4StreamOptions as Experimental_SpeechTranslationModelV4StreamOptions, type SpeechTranslationModelV4StreamPart as Experimental_SpeechTranslationModelV4StreamPart, type SpeechTranslationModelV4StreamResult as Experimental_SpeechTranslationModelV4StreamResult, type SpeechTranslationModelV4Usage as Experimental_SpeechTranslationModelV4Usage, type TranscriptionModelV4StreamOptions as Experimental_TranscriptionModelV4StreamOptions, type TranscriptionModelV4StreamPart as Experimental_TranscriptionModelV4StreamPart, type TranscriptionModelV4StreamResult as Experimental_TranscriptionModelV4StreamResult, type VideoModelV3 as Experimental_VideoModelV3, type VideoModelV3CallOptions as Experimental_VideoModelV3CallOptions, type VideoModelV3File as Experimental_VideoModelV3File, type VideoModelV3FrameImage as Experimental_VideoModelV3FrameImage, type VideoModelV3FrameType as Experimental_VideoModelV3FrameType, type VideoModelV3VideoData as Experimental_VideoModelV3VideoData, type VideoModelV4 as Experimental_VideoModelV4, type VideoModelV4CallOptions as Experimental_VideoModelV4CallOptions, type VideoModelV4File as Experimental_VideoModelV4File, type VideoModelV4FrameImage as Experimental_VideoModelV4FrameImage, type VideoModelV4FrameType as Experimental_VideoModelV4FrameType, type VideoModelV4OperationStartResult as Experimental_VideoModelV4OperationStartResult, type VideoModelV4OperationStatusResult as Experimental_VideoModelV4OperationStatusResult, type VideoModelV4OperationWebhook as Experimental_VideoModelV4OperationWebhook, type VideoModelV4Result as Experimental_VideoModelV4Result, type VideoModelV4VideoData as Experimental_VideoModelV4VideoData, type FilesV4, type FilesV4DeleteFileCallOptions, type FilesV4DeleteFileResult, type FilesV4DownloadFileCallOptions, type FilesV4DownloadFileResult, type FilesV4GetFileMetadataCallOptions, type FilesV4GetFileMetadataResult, type FilesV4UploadFileCallOptions, type FilesV4UploadFileResult, type FilesV4UploadFileStreamData, type ImageModelV2, type ImageModelV2CallOptions, type ImageModelV2CallWarning, type ImageModelV2ProviderMetadata, type ImageModelV3, type ImageModelV3CallOptions, type ImageModelV3File, type ImageModelV3Middleware, type ImageModelV3ProviderMetadata, type ImageModelV3Usage, type ImageModelV4, type ImageModelV4CallOptions, type ImageModelV4File, type ImageModelV4Middleware, type ImageModelV4ProviderMetadata, type ImageModelV4Result, type ImageModelV4Usage, InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV2, type LanguageModelV2CallOptions, type LanguageModelV2CallWarning, type LanguageModelV2Content, type LanguageModelV2DataContent, type LanguageModelV2File, type LanguageModelV2FilePart, type LanguageModelV2FinishReason, type LanguageModelV2FunctionTool, type LanguageModelV2Message, type LanguageModelV2Middleware, type LanguageModelV2Prompt, type LanguageModelV2ProviderDefinedTool, type LanguageModelV2Reasoning, type LanguageModelV2ReasoningPart, type LanguageModelV2ResponseMetadata, type LanguageModelV2Source, type LanguageModelV2StreamPart, type LanguageModelV2Text, type LanguageModelV2TextPart, type LanguageModelV2ToolCall, type LanguageModelV2ToolCallPart, type LanguageModelV2ToolChoice, type LanguageModelV2ToolResultOutput, type LanguageModelV2ToolResultPart, type LanguageModelV2Usage, type LanguageModelV3, type LanguageModelV3CallOptions, type LanguageModelV3Content, type LanguageModelV3DataContent, type LanguageModelV3File, type LanguageModelV3FilePart, type LanguageModelV3FinishReason, type LanguageModelV3FunctionTool, type LanguageModelV3GenerateResult, type LanguageModelV3Message, type LanguageModelV3Middleware, type LanguageModelV3Prompt, type LanguageModelV3ProviderTool, type LanguageModelV3Reasoning, type LanguageModelV3ReasoningPart, type LanguageModelV3ResponseMetadata, type LanguageModelV3Source, type LanguageModelV3StreamPart, type LanguageModelV3StreamResult, type LanguageModelV3Text, type LanguageModelV3TextPart, type LanguageModelV3ToolApprovalRequest, type LanguageModelV3ToolApprovalResponsePart, type LanguageModelV3ToolCall, type LanguageModelV3ToolCallPart, type LanguageModelV3ToolChoice, type LanguageModelV3ToolResult, type LanguageModelV3ToolResultOutput, type LanguageModelV3ToolResultPart, type LanguageModelV3Usage, type LanguageModelV4, type LanguageModelV4CallOptions, type LanguageModelV4Content, type LanguageModelV4CustomContent, type LanguageModelV4CustomPart, type LanguageModelV4File, type LanguageModelV4FilePart, type LanguageModelV4FinishReason, type LanguageModelV4FunctionTool, type LanguageModelV4GenerateResult, type LanguageModelV4Message, type LanguageModelV4Middleware, type LanguageModelV4Prompt, type LanguageModelV4ProviderTool, type LanguageModelV4Reasoning, type LanguageModelV4ReasoningFile, type LanguageModelV4ReasoningFilePart, type LanguageModelV4ReasoningPart, type LanguageModelV4ResponseMetadata, type LanguageModelV4Source, type LanguageModelV4StreamPart, type LanguageModelV4StreamResult, type LanguageModelV4Text, type LanguageModelV4TextPart, type LanguageModelV4ToolApprovalRequest, type LanguageModelV4ToolApprovalResponsePart, type LanguageModelV4ToolCall, type LanguageModelV4ToolCallPart, type LanguageModelV4ToolChoice, type LanguageModelV4ToolResult, type LanguageModelV4ToolResultOutput, type LanguageModelV4ToolResultPart, type LanguageModelV4Usage, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, NoSuchProviderReferenceError, type ProviderV2, type ProviderV3, type ProviderV4, type RerankingModelV3, type RerankingModelV3CallOptions, type RerankingModelV4, type RerankingModelV4CallOptions, type RerankingModelV4Result, type SharedV2Headers, type SharedV2ProviderMetadata, type SharedV2ProviderOptions, type SharedV3Headers, type SharedV3ProviderMetadata, type SharedV3ProviderOptions, type SharedV3Warning, type SharedV4AudioFormat, type SharedV4FileData, type SharedV4FileDataData, type SharedV4FileDataReference, type SharedV4FileDataText, type SharedV4FileDataUrl, type SharedV4Headers, type SharedV4ProviderMetadata, type SharedV4ProviderOptions, type SharedV4ProviderReference, type SharedV4Warning, type SkillsV4, type SkillsV4File, type SkillsV4UploadSkillCallOptions, type SkillsV4UploadSkillResult, type SpeechModelV2, type SpeechModelV2CallOptions, type SpeechModelV2CallWarning, type SpeechModelV3, type SpeechModelV3CallOptions, type SpeechModelV4, type SpeechModelV4CallOptions, type SpeechModelV4Result, TooManyEmbeddingValuesForCallError, type TranscriptionModelV2, type TranscriptionModelV2CallOptions, type TranscriptionModelV2CallWarning, type TranscriptionModelV3, type TranscriptionModelV3CallOptions, type TranscriptionModelV4, type TranscriptionModelV4CallOptions, type TranscriptionModelV4Result, type TypeValidationContext, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };
8470
+ export { AISDKError, APICallError, type EmbeddingModelV2, type EmbeddingModelV2Embedding, type EmbeddingModelV3, type EmbeddingModelV3CallOptions, type EmbeddingModelV3Embedding, type EmbeddingModelV3Middleware, type EmbeddingModelV3Result, type EmbeddingModelV4, type EmbeddingModelV4CallOptions, type EmbeddingModelV4Embedding, type EmbeddingModelV4Middleware, type EmbeddingModelV4Result, EmptyResponseBodyError, type BatchV4 as Experimental_BatchV4, type BatchV4CancelResult as Experimental_BatchV4CancelResult, type BatchV4Error as Experimental_BatchV4Error, type BatchV4ItemResult as Experimental_BatchV4ItemResult, type BatchV4ListItem as Experimental_BatchV4ListItem, type BatchV4ListOptions as Experimental_BatchV4ListOptions, type BatchV4ListResult as Experimental_BatchV4ListResult, type BatchV4ModelIds as Experimental_BatchV4ModelIds, type BatchV4OperationOptions as Experimental_BatchV4OperationOptions, type BatchV4Request as Experimental_BatchV4Request, type BatchV4RequestBase as Experimental_BatchV4RequestBase, type BatchV4StartOptions as Experimental_BatchV4StartOptions, type BatchV4StartResult as Experimental_BatchV4StartResult, type BatchV4Status as Experimental_BatchV4Status, type EvaluationModelV4 as Experimental_EvaluationModelV4, type EvaluationModelV4Answer as Experimental_EvaluationModelV4Answer, type EvaluationModelV4CallOptions as Experimental_EvaluationModelV4CallOptions, type EvaluationModelV4Input as Experimental_EvaluationModelV4Input, type EvaluationModelV4Question as Experimental_EvaluationModelV4Question, type EvaluationModelV4Result as Experimental_EvaluationModelV4Result, EvaluationUnsupportedQuestionTypeError as Experimental_EvaluationUnsupportedQuestionTypeError, type ImageBatchV4ItemResult as Experimental_ImageBatchV4ItemResult, type ImageBatchV4Request as Experimental_ImageBatchV4Request, type RealtimeFactoryV4 as Experimental_RealtimeFactoryV4, type RealtimeFactoryV4GetTokenOptions as Experimental_RealtimeFactoryV4GetTokenOptions, type RealtimeFactoryV4GetTokenResult as Experimental_RealtimeFactoryV4GetTokenResult, type RealtimeModelV4 as Experimental_RealtimeModelV4, type RealtimeModelV4AudioMessage as Experimental_RealtimeModelV4AudioMessage, type RealtimeModelV4ClientEvent as Experimental_RealtimeModelV4ClientEvent, type RealtimeModelV4ClientSecretOptions as Experimental_RealtimeModelV4ClientSecretOptions, type RealtimeModelV4ClientSecretResult as Experimental_RealtimeModelV4ClientSecretResult, type RealtimeModelV4ConversationItem as Experimental_RealtimeModelV4ConversationItem, type RealtimeModelV4FunctionCallOutput as Experimental_RealtimeModelV4FunctionCallOutput, type RealtimeModelV4ServerEvent as Experimental_RealtimeModelV4ServerEvent, type RealtimeModelV4SessionConfig as Experimental_RealtimeModelV4SessionConfig, type RealtimeModelV4TextMessage as Experimental_RealtimeModelV4TextMessage, type RealtimeModelV4ToolDefinition as Experimental_RealtimeModelV4ToolDefinition, type SpeechTranslationModelV4 as Experimental_SpeechTranslationModelV4, type SpeechTranslationModelV4StreamOptions as Experimental_SpeechTranslationModelV4StreamOptions, type SpeechTranslationModelV4StreamPart as Experimental_SpeechTranslationModelV4StreamPart, type SpeechTranslationModelV4StreamResult as Experimental_SpeechTranslationModelV4StreamResult, type SpeechTranslationModelV4Usage as Experimental_SpeechTranslationModelV4Usage, type TextBatchV4ItemResult as Experimental_TextBatchV4ItemResult, type TextBatchV4Request as Experimental_TextBatchV4Request, type TranscriptionModelV4StreamOptions as Experimental_TranscriptionModelV4StreamOptions, type TranscriptionModelV4StreamPart as Experimental_TranscriptionModelV4StreamPart, type TranscriptionModelV4StreamResult as Experimental_TranscriptionModelV4StreamResult, type VideoModelV3 as Experimental_VideoModelV3, type VideoModelV3CallOptions as Experimental_VideoModelV3CallOptions, type VideoModelV3File as Experimental_VideoModelV3File, type VideoModelV3FrameImage as Experimental_VideoModelV3FrameImage, type VideoModelV3FrameType as Experimental_VideoModelV3FrameType, type VideoModelV3VideoData as Experimental_VideoModelV3VideoData, type VideoModelV4 as Experimental_VideoModelV4, type VideoModelV4CallOptions as Experimental_VideoModelV4CallOptions, type VideoModelV4File as Experimental_VideoModelV4File, type VideoModelV4FrameImage as Experimental_VideoModelV4FrameImage, type VideoModelV4FrameType as Experimental_VideoModelV4FrameType, type VideoModelV4OperationStartResult as Experimental_VideoModelV4OperationStartResult, type VideoModelV4OperationStatusResult as Experimental_VideoModelV4OperationStatusResult, type VideoModelV4OperationWebhook as Experimental_VideoModelV4OperationWebhook, type VideoModelV4Result as Experimental_VideoModelV4Result, type VideoModelV4VideoData as Experimental_VideoModelV4VideoData, type FilesV4, type FilesV4DeleteFileCallOptions, type FilesV4DeleteFileResult, type FilesV4DownloadFileCallOptions, type FilesV4DownloadFileResult, type FilesV4GetFileMetadataCallOptions, type FilesV4GetFileMetadataResult, type FilesV4UploadFileCallOptions, type FilesV4UploadFileResult, type FilesV4UploadFileStreamData, type ImageModelV2, type ImageModelV2CallOptions, type ImageModelV2CallWarning, type ImageModelV2ProviderMetadata, type ImageModelV3, type ImageModelV3CallOptions, type ImageModelV3File, type ImageModelV3Middleware, type ImageModelV3ProviderMetadata, type ImageModelV3Usage, type ImageModelV4, type ImageModelV4CallOptions, type ImageModelV4File, type ImageModelV4Middleware, type ImageModelV4ProviderMetadata, type ImageModelV4Result, type ImageModelV4Usage, InvalidArgumentError, InvalidPromptError, InvalidResponseDataError, type JSONArray, type JSONObject, JSONParseError, type JSONValue, type LanguageModelV2, type LanguageModelV2CallOptions, type LanguageModelV2CallWarning, type LanguageModelV2Content, type LanguageModelV2DataContent, type LanguageModelV2File, type LanguageModelV2FilePart, type LanguageModelV2FinishReason, type LanguageModelV2FunctionTool, type LanguageModelV2Message, type LanguageModelV2Middleware, type LanguageModelV2Prompt, type LanguageModelV2ProviderDefinedTool, type LanguageModelV2Reasoning, type LanguageModelV2ReasoningPart, type LanguageModelV2ResponseMetadata, type LanguageModelV2Source, type LanguageModelV2StreamPart, type LanguageModelV2Text, type LanguageModelV2TextPart, type LanguageModelV2ToolCall, type LanguageModelV2ToolCallPart, type LanguageModelV2ToolChoice, type LanguageModelV2ToolResultOutput, type LanguageModelV2ToolResultPart, type LanguageModelV2Usage, type LanguageModelV3, type LanguageModelV3CallOptions, type LanguageModelV3Content, type LanguageModelV3DataContent, type LanguageModelV3File, type LanguageModelV3FilePart, type LanguageModelV3FinishReason, type LanguageModelV3FunctionTool, type LanguageModelV3GenerateResult, type LanguageModelV3Message, type LanguageModelV3Middleware, type LanguageModelV3Prompt, type LanguageModelV3ProviderTool, type LanguageModelV3Reasoning, type LanguageModelV3ReasoningPart, type LanguageModelV3ResponseMetadata, type LanguageModelV3Source, type LanguageModelV3StreamPart, type LanguageModelV3StreamResult, type LanguageModelV3Text, type LanguageModelV3TextPart, type LanguageModelV3ToolApprovalRequest, type LanguageModelV3ToolApprovalResponsePart, type LanguageModelV3ToolCall, type LanguageModelV3ToolCallPart, type LanguageModelV3ToolChoice, type LanguageModelV3ToolResult, type LanguageModelV3ToolResultOutput, type LanguageModelV3ToolResultPart, type LanguageModelV3Usage, type LanguageModelV4, type LanguageModelV4CallOptions, type LanguageModelV4Content, type LanguageModelV4CustomContent, type LanguageModelV4CustomPart, type LanguageModelV4File, type LanguageModelV4FilePart, type LanguageModelV4FinishReason, type LanguageModelV4FunctionTool, type LanguageModelV4GenerateResult, type LanguageModelV4Message, type LanguageModelV4Middleware, type LanguageModelV4Prompt, type LanguageModelV4ProviderTool, type LanguageModelV4Reasoning, type LanguageModelV4ReasoningFile, type LanguageModelV4ReasoningFilePart, type LanguageModelV4ReasoningPart, type LanguageModelV4ResponseMetadata, type LanguageModelV4Source, type LanguageModelV4StreamPart, type LanguageModelV4StreamResult, type LanguageModelV4Text, type LanguageModelV4TextPart, type LanguageModelV4ToolApprovalRequest, type LanguageModelV4ToolApprovalResponsePart, type LanguageModelV4ToolCall, type LanguageModelV4ToolCallPart, type LanguageModelV4ToolChoice, type LanguageModelV4ToolResult, type LanguageModelV4ToolResultOutput, type LanguageModelV4ToolResultPart, type LanguageModelV4Usage, LoadAPIKeyError, LoadSettingError, NoContentGeneratedError, NoSuchModelError, NoSuchProviderReferenceError, type ProviderV2, type ProviderV3, type ProviderV4, type RerankingModelV3, type RerankingModelV3CallOptions, type RerankingModelV4, type RerankingModelV4CallOptions, type RerankingModelV4Result, type SharedV2Headers, type SharedV2ProviderMetadata, type SharedV2ProviderOptions, type SharedV3Headers, type SharedV3ProviderMetadata, type SharedV3ProviderOptions, type SharedV3Warning, type SharedV4AudioFormat, type SharedV4FileData, type SharedV4FileDataData, type SharedV4FileDataReference, type SharedV4FileDataText, type SharedV4FileDataUrl, type SharedV4Headers, type SharedV4ProviderMetadata, type SharedV4ProviderOptions, type SharedV4ProviderReference, type SharedV4Warning, type SkillsV4, type SkillsV4File, type SkillsV4UploadSkillCallOptions, type SkillsV4UploadSkillResult, type SpeechModelV2, type SpeechModelV2CallOptions, type SpeechModelV2CallWarning, type SpeechModelV3, type SpeechModelV3CallOptions, type SpeechModelV4, type SpeechModelV4CallOptions, type SpeechModelV4Result, TooManyEmbeddingValuesForCallError, type TranscriptionModelV2, type TranscriptionModelV2CallOptions, type TranscriptionModelV2CallWarning, type TranscriptionModelV3, type TranscriptionModelV3CallOptions, type TranscriptionModelV4, type TranscriptionModelV4CallOptions, type TranscriptionModelV4Result, type TypeValidationContext, TypeValidationError, UnsupportedFunctionalityError, getErrorMessage, isJSONArray, isJSONObject, isJSONValue };