@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/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "@ai-sdk/provider-utils";
|
|
13
13
|
|
|
14
14
|
// src/version.ts
|
|
15
|
-
var VERSION = true ? "3.0.
|
|
15
|
+
var VERSION = true ? "3.0.36" : "0.0.0-test";
|
|
16
16
|
|
|
17
17
|
// src/anthropic-messages-language-model.ts
|
|
18
18
|
import {
|
|
@@ -1771,6 +1771,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1771
1771
|
switch (output.type) {
|
|
1772
1772
|
case "content":
|
|
1773
1773
|
contentValue = output.value.map((contentPart) => {
|
|
1774
|
+
var _a2;
|
|
1774
1775
|
switch (contentPart.type) {
|
|
1775
1776
|
case "text":
|
|
1776
1777
|
return {
|
|
@@ -1823,6 +1824,20 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1823
1824
|
});
|
|
1824
1825
|
return void 0;
|
|
1825
1826
|
}
|
|
1827
|
+
case "custom": {
|
|
1828
|
+
const anthropicOptions = (_a2 = contentPart.providerOptions) == null ? void 0 : _a2.anthropic;
|
|
1829
|
+
if ((anthropicOptions == null ? void 0 : anthropicOptions.type) === "tool-reference") {
|
|
1830
|
+
return {
|
|
1831
|
+
type: "tool_reference",
|
|
1832
|
+
tool_name: anthropicOptions.toolName
|
|
1833
|
+
};
|
|
1834
|
+
}
|
|
1835
|
+
warnings.push({
|
|
1836
|
+
type: "other",
|
|
1837
|
+
message: `unsupported custom tool content part`
|
|
1838
|
+
});
|
|
1839
|
+
return void 0;
|
|
1840
|
+
}
|
|
1826
1841
|
default: {
|
|
1827
1842
|
warnings.push({
|
|
1828
1843
|
type: "other",
|