@ai-sdk/anthropic 3.0.34 → 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 +14 -0
- package/dist/index.js +16 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +15 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +15 -0
- package/dist/internal/index.mjs.map +1 -1
- package/docs/05-anthropic.mdx +51 -0
- package/package.json +3 -3
- package/src/anthropic-messages-api.ts +6 -0
- package/src/convert-to-anthropic-messages-prompt.ts +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
9
|
+
## 3.0.35
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [53f6731]
|
|
14
|
+
- @ai-sdk/provider@3.0.7
|
|
15
|
+
- @ai-sdk/provider-utils@4.0.13
|
|
16
|
+
|
|
3
17
|
## 3.0.34
|
|
4
18
|
|
|
5
19
|
### 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
|
+
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",
|