@ai-sdk/anthropic 3.0.80 → 3.0.81

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.
@@ -2243,19 +2243,20 @@ async function convertToAnthropicMessagesPrompt({
2243
2243
  const type = block.type;
2244
2244
  switch (type) {
2245
2245
  case "system": {
2246
- if (system != null) {
2247
- throw new UnsupportedFunctionalityError2({
2248
- functionality: "Multiple system messages that are separated by user/assistant messages"
2249
- });
2250
- }
2251
- system = block.messages.map(({ content, providerOptions }) => ({
2246
+ const content = block.messages.map(({ content: content2, providerOptions }) => ({
2252
2247
  type: "text",
2253
- text: content,
2248
+ text: content2,
2254
2249
  cache_control: validator.getCacheControl(providerOptions, {
2255
2250
  type: "system message",
2256
2251
  canCache: true
2257
2252
  })
2258
2253
  }));
2254
+ if (system == null) {
2255
+ system = content;
2256
+ } else {
2257
+ messages.push({ role: "system", content });
2258
+ betas.add("mid-conversation-system-2026-04-07");
2259
+ }
2259
2260
  break;
2260
2261
  }
2261
2262
  case "user": {
@@ -5117,7 +5118,7 @@ var AnthropicMessagesLanguageModel = class {
5117
5118
  }
5118
5119
  };
5119
5120
  function getModelCapabilities(modelId) {
5120
- if (modelId.includes("claude-opus-4-7")) {
5121
+ if (modelId.includes("claude-opus-4-8") || modelId.includes("claude-opus-4-7")) {
5121
5122
  return {
5122
5123
  maxOutputTokens: 128e3,
5123
5124
  supportsStructuredOutput: true,
@@ -5575,7 +5576,7 @@ var anthropicTools = {
5575
5576
  * Supported executor models: Claude Haiku 4.5, Sonnet 4.6, Opus 4.6,
5576
5577
  * Opus 4.7. The advisor must be at least as capable as the executor.
5577
5578
  *
5578
- * @param model - The advisor model ID (required), e.g. `"claude-opus-4-7"`.
5579
+ * @param model - The advisor model ID (required), e.g. `"claude-opus-4-8"`.
5579
5580
  * @param maxUses - Maximum advisor calls per request (per-request cap).
5580
5581
  * @param caching - Enables prompt caching for the advisor's transcript
5581
5582
  * across calls within a conversation. Worthwhile from ~3 advisor calls