@ai-sdk/anthropic 3.0.0-beta.31 → 3.0.0-beta.33

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.
@@ -242,7 +242,18 @@ var anthropicMessagesResponseSchema = lazySchema2(
242
242
  output_tokens: z2.number(),
243
243
  cache_creation_input_tokens: z2.number().nullish(),
244
244
  cache_read_input_tokens: z2.number().nullish()
245
- })
245
+ }),
246
+ container: z2.object({
247
+ expires_at: z2.string(),
248
+ id: z2.string(),
249
+ skills: z2.array(
250
+ z2.object({
251
+ type: z2.union([z2.literal("anthropic"), z2.literal("custom")]),
252
+ skill_id: z2.string(),
253
+ version: z2.string()
254
+ })
255
+ ).nullish()
256
+ }).nullish()
246
257
  })
247
258
  )
248
259
  );
@@ -490,7 +501,21 @@ var anthropicMessagesChunkSchema = lazySchema2(
490
501
  type: z2.literal("message_delta"),
491
502
  delta: z2.object({
492
503
  stop_reason: z2.string().nullish(),
493
- stop_sequence: z2.string().nullish()
504
+ stop_sequence: z2.string().nullish(),
505
+ container: z2.object({
506
+ expires_at: z2.string(),
507
+ id: z2.string(),
508
+ skills: z2.array(
509
+ z2.object({
510
+ type: z2.union([
511
+ z2.literal("anthropic"),
512
+ z2.literal("custom")
513
+ ]),
514
+ skill_id: z2.string(),
515
+ version: z2.string()
516
+ })
517
+ ).nullish()
518
+ }).nullish()
494
519
  }),
495
520
  usage: z2.looseObject({
496
521
  output_tokens: z2.number(),
@@ -2071,7 +2096,7 @@ var AnthropicMessagesLanguageModel = class {
2071
2096
  });
2072
2097
  }
2073
2098
  async doGenerate(options) {
2074
- var _a, _b, _c, _d, _e, _f;
2099
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2075
2100
  const { args, warnings, betas, usesJsonResponseTool } = await this.getArgs(options);
2076
2101
  const citationDocuments = this.extractCitationDocuments(options.prompt);
2077
2102
  const {
@@ -2354,7 +2379,16 @@ var AnthropicMessagesLanguageModel = class {
2354
2379
  anthropic: {
2355
2380
  usage: response.usage,
2356
2381
  cacheCreationInputTokens: (_e = response.usage.cache_creation_input_tokens) != null ? _e : null,
2357
- stopSequence: (_f = response.stop_sequence) != null ? _f : null
2382
+ stopSequence: (_f = response.stop_sequence) != null ? _f : null,
2383
+ container: response.container ? {
2384
+ expiresAt: response.container.expires_at,
2385
+ id: response.container.id,
2386
+ skills: (_h = (_g = response.container.skills) == null ? void 0 : _g.map((skill) => ({
2387
+ type: skill.type,
2388
+ skillId: skill.skill_id,
2389
+ version: skill.version
2390
+ }))) != null ? _h : null
2391
+ } : null
2358
2392
  }
2359
2393
  }
2360
2394
  };
@@ -2385,6 +2419,7 @@ var AnthropicMessagesLanguageModel = class {
2385
2419
  let rawUsage = void 0;
2386
2420
  let cacheCreationInputTokens = null;
2387
2421
  let stopSequence = null;
2422
+ let container = null;
2388
2423
  let blockType = void 0;
2389
2424
  const generateId2 = this.generateId;
2390
2425
  return {
@@ -2394,7 +2429,7 @@ var AnthropicMessagesLanguageModel = class {
2394
2429
  controller.enqueue({ type: "stream-start", warnings });
2395
2430
  },
2396
2431
  transform(chunk, controller) {
2397
- var _a, _b, _c, _d, _e, _f, _g, _h;
2432
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2398
2433
  if (options.includeRawChunks) {
2399
2434
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
2400
2435
  }
@@ -2803,6 +2838,15 @@ var AnthropicMessagesLanguageModel = class {
2803
2838
  isJsonResponseFromTool: usesJsonResponseTool
2804
2839
  });
2805
2840
  stopSequence = (_h = value.delta.stop_sequence) != null ? _h : null;
2841
+ container = value.delta.container != null ? {
2842
+ expiresAt: value.delta.container.expires_at,
2843
+ id: value.delta.container.id,
2844
+ skills: (_j = (_i = value.delta.container.skills) == null ? void 0 : _i.map((skill) => ({
2845
+ type: skill.type,
2846
+ skillId: skill.skill_id,
2847
+ version: skill.version
2848
+ }))) != null ? _j : null
2849
+ } : null;
2806
2850
  rawUsage = {
2807
2851
  ...rawUsage,
2808
2852
  ...value.usage
@@ -2818,7 +2862,8 @@ var AnthropicMessagesLanguageModel = class {
2818
2862
  anthropic: {
2819
2863
  usage: rawUsage != null ? rawUsage : null,
2820
2864
  cacheCreationInputTokens,
2821
- stopSequence
2865
+ stopSequence,
2866
+ container
2822
2867
  }
2823
2868
  }
2824
2869
  });