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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  } from "@ai-sdk/provider-utils";
11
11
 
12
12
  // src/version.ts
13
- var VERSION = true ? "3.0.0-beta.31" : "0.0.0-test";
13
+ var VERSION = true ? "3.0.0-beta.32" : "0.0.0-test";
14
14
 
15
15
  // src/anthropic-messages-language-model.ts
16
16
  import {
@@ -256,7 +256,18 @@ var anthropicMessagesResponseSchema = lazySchema2(
256
256
  output_tokens: z2.number(),
257
257
  cache_creation_input_tokens: z2.number().nullish(),
258
258
  cache_read_input_tokens: z2.number().nullish()
259
- })
259
+ }),
260
+ container: z2.object({
261
+ expires_at: z2.string(),
262
+ id: z2.string(),
263
+ skills: z2.array(
264
+ z2.object({
265
+ type: z2.union([z2.literal("anthropic"), z2.literal("custom")]),
266
+ skill_id: z2.string(),
267
+ version: z2.string()
268
+ })
269
+ ).nullish()
270
+ }).nullish()
260
271
  })
261
272
  )
262
273
  );
@@ -504,7 +515,21 @@ var anthropicMessagesChunkSchema = lazySchema2(
504
515
  type: z2.literal("message_delta"),
505
516
  delta: z2.object({
506
517
  stop_reason: z2.string().nullish(),
507
- stop_sequence: z2.string().nullish()
518
+ stop_sequence: z2.string().nullish(),
519
+ container: z2.object({
520
+ expires_at: z2.string(),
521
+ id: z2.string(),
522
+ skills: z2.array(
523
+ z2.object({
524
+ type: z2.union([
525
+ z2.literal("anthropic"),
526
+ z2.literal("custom")
527
+ ]),
528
+ skill_id: z2.string(),
529
+ version: z2.string()
530
+ })
531
+ ).nullish()
532
+ }).nullish()
508
533
  }),
509
534
  usage: z2.looseObject({
510
535
  output_tokens: z2.number(),
@@ -2085,7 +2110,7 @@ var AnthropicMessagesLanguageModel = class {
2085
2110
  });
2086
2111
  }
2087
2112
  async doGenerate(options) {
2088
- var _a, _b, _c, _d, _e, _f;
2113
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2089
2114
  const { args, warnings, betas, usesJsonResponseTool } = await this.getArgs(options);
2090
2115
  const citationDocuments = this.extractCitationDocuments(options.prompt);
2091
2116
  const {
@@ -2368,7 +2393,16 @@ var AnthropicMessagesLanguageModel = class {
2368
2393
  anthropic: {
2369
2394
  usage: response.usage,
2370
2395
  cacheCreationInputTokens: (_e = response.usage.cache_creation_input_tokens) != null ? _e : null,
2371
- stopSequence: (_f = response.stop_sequence) != null ? _f : null
2396
+ stopSequence: (_f = response.stop_sequence) != null ? _f : null,
2397
+ container: response.container ? {
2398
+ expiresAt: response.container.expires_at,
2399
+ id: response.container.id,
2400
+ skills: (_h = (_g = response.container.skills) == null ? void 0 : _g.map((skill) => ({
2401
+ type: skill.type,
2402
+ skillId: skill.skill_id,
2403
+ version: skill.version
2404
+ }))) != null ? _h : null
2405
+ } : null
2372
2406
  }
2373
2407
  }
2374
2408
  };
@@ -2399,6 +2433,7 @@ var AnthropicMessagesLanguageModel = class {
2399
2433
  let rawUsage = void 0;
2400
2434
  let cacheCreationInputTokens = null;
2401
2435
  let stopSequence = null;
2436
+ let container = null;
2402
2437
  let blockType = void 0;
2403
2438
  const generateId3 = this.generateId;
2404
2439
  return {
@@ -2408,7 +2443,7 @@ var AnthropicMessagesLanguageModel = class {
2408
2443
  controller.enqueue({ type: "stream-start", warnings });
2409
2444
  },
2410
2445
  transform(chunk, controller) {
2411
- var _a, _b, _c, _d, _e, _f, _g, _h;
2446
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2412
2447
  if (options.includeRawChunks) {
2413
2448
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
2414
2449
  }
@@ -2817,6 +2852,15 @@ var AnthropicMessagesLanguageModel = class {
2817
2852
  isJsonResponseFromTool: usesJsonResponseTool
2818
2853
  });
2819
2854
  stopSequence = (_h = value.delta.stop_sequence) != null ? _h : null;
2855
+ container = value.delta.container != null ? {
2856
+ expiresAt: value.delta.container.expires_at,
2857
+ id: value.delta.container.id,
2858
+ skills: (_j = (_i = value.delta.container.skills) == null ? void 0 : _i.map((skill) => ({
2859
+ type: skill.type,
2860
+ skillId: skill.skill_id,
2861
+ version: skill.version
2862
+ }))) != null ? _j : null
2863
+ } : null;
2820
2864
  rawUsage = {
2821
2865
  ...rawUsage,
2822
2866
  ...value.usage
@@ -2832,7 +2876,8 @@ var AnthropicMessagesLanguageModel = class {
2832
2876
  anthropic: {
2833
2877
  usage: rawUsage != null ? rawUsage : null,
2834
2878
  cacheCreationInputTokens,
2835
- stopSequence
2879
+ stopSequence,
2880
+ container
2836
2881
  }
2837
2882
  }
2838
2883
  });