@ai-sdk/anthropic 3.0.35 → 3.0.36

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,11 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 3.0.36
4
+
5
+ ### Patch Changes
6
+
7
+ - 1652320: feat(anthropic): support custom tool-reference content for deferred tool loading
8
+
3
9
  ## 3.0.35
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ var import_provider4 = require("@ai-sdk/provider");
32
32
  var import_provider_utils23 = require("@ai-sdk/provider-utils");
33
33
 
34
34
  // src/version.ts
35
- var VERSION = true ? "3.0.35" : "0.0.0-test";
35
+ var VERSION = true ? "3.0.36" : "0.0.0-test";
36
36
 
37
37
  // src/anthropic-messages-language-model.ts
38
38
  var import_provider3 = require("@ai-sdk/provider");
@@ -1747,6 +1747,7 @@ async function convertToAnthropicMessagesPrompt({
1747
1747
  switch (output.type) {
1748
1748
  case "content":
1749
1749
  contentValue = output.value.map((contentPart) => {
1750
+ var _a2;
1750
1751
  switch (contentPart.type) {
1751
1752
  case "text":
1752
1753
  return {
@@ -1799,6 +1800,20 @@ async function convertToAnthropicMessagesPrompt({
1799
1800
  });
1800
1801
  return void 0;
1801
1802
  }
1803
+ case "custom": {
1804
+ const anthropicOptions = (_a2 = contentPart.providerOptions) == null ? void 0 : _a2.anthropic;
1805
+ if ((anthropicOptions == null ? void 0 : anthropicOptions.type) === "tool-reference") {
1806
+ return {
1807
+ type: "tool_reference",
1808
+ tool_name: anthropicOptions.toolName
1809
+ };
1810
+ }
1811
+ warnings.push({
1812
+ type: "other",
1813
+ message: `unsupported custom tool content part`
1814
+ });
1815
+ return void 0;
1816
+ }
1802
1817
  default: {
1803
1818
  warnings.push({
1804
1819
  type: "other",