@ai-sdk/anthropic 2.0.65 → 2.0.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.0.67
4
+
5
+ ### Patch Changes
6
+
7
+ - e1b08a6: Pass `cacheControl` provider option as top-level `cache_control` in Anthropic API request body to support automatic caching.
8
+
9
+ ## 2.0.66
10
+
11
+ ### Patch Changes
12
+
13
+ - b153525: fix compaction_delta streaming schema to allow null content
14
+
3
15
  ## 2.0.65
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -31,7 +31,7 @@ var import_provider4 = require("@ai-sdk/provider");
31
31
  var import_provider_utils20 = require("@ai-sdk/provider-utils");
32
32
 
33
33
  // src/version.ts
34
- var VERSION = true ? "2.0.65" : "0.0.0-test";
34
+ var VERSION = true ? "2.0.67" : "0.0.0-test";
35
35
 
36
36
  // src/anthropic-messages-language-model.ts
37
37
  var import_provider3 = require("@ai-sdk/provider");
@@ -491,7 +491,7 @@ var anthropicMessagesChunkSchema = (0, import_provider_utils2.lazySchema)(
491
491
  }),
492
492
  import_v42.z.object({
493
493
  type: import_v42.z.literal("compaction_delta"),
494
- content: import_v42.z.string()
494
+ content: import_v42.z.string().nullish()
495
495
  }),
496
496
  import_v42.z.object({
497
497
  type: import_v42.z.literal("citations_delta"),
@@ -2043,6 +2043,9 @@ var AnthropicMessagesLanguageModel = class {
2043
2043
  ...(anthropicOptions == null ? void 0 : anthropicOptions.speed) && {
2044
2044
  speed: anthropicOptions.speed
2045
2045
  },
2046
+ ...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
2047
+ cache_control: anthropicOptions.cacheControl
2048
+ },
2046
2049
  // structured output:
2047
2050
  ...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
2048
2051
  output_format: {
@@ -2960,11 +2963,13 @@ var AnthropicMessagesLanguageModel = class {
2960
2963
  return;
2961
2964
  }
2962
2965
  case "compaction_delta": {
2963
- controller.enqueue({
2964
- type: "text-delta",
2965
- id: String(value.index),
2966
- delta: value.delta.content
2967
- });
2966
+ if (value.delta.content != null) {
2967
+ controller.enqueue({
2968
+ type: "text-delta",
2969
+ id: String(value.index),
2970
+ delta: value.delta.content
2971
+ });
2972
+ }
2968
2973
  return;
2969
2974
  }
2970
2975
  case "input_json_delta": {