@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/internal/index.js
CHANGED
|
@@ -1739,6 +1739,7 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1739
1739
|
switch (output.type) {
|
|
1740
1740
|
case "content":
|
|
1741
1741
|
contentValue = output.value.map((contentPart) => {
|
|
1742
|
+
var _a2;
|
|
1742
1743
|
switch (contentPart.type) {
|
|
1743
1744
|
case "text":
|
|
1744
1745
|
return {
|
|
@@ -1791,6 +1792,20 @@ async function convertToAnthropicMessagesPrompt({
|
|
|
1791
1792
|
});
|
|
1792
1793
|
return void 0;
|
|
1793
1794
|
}
|
|
1795
|
+
case "custom": {
|
|
1796
|
+
const anthropicOptions = (_a2 = contentPart.providerOptions) == null ? void 0 : _a2.anthropic;
|
|
1797
|
+
if ((anthropicOptions == null ? void 0 : anthropicOptions.type) === "tool-reference") {
|
|
1798
|
+
return {
|
|
1799
|
+
type: "tool_reference",
|
|
1800
|
+
tool_name: anthropicOptions.toolName
|
|
1801
|
+
};
|
|
1802
|
+
}
|
|
1803
|
+
warnings.push({
|
|
1804
|
+
type: "other",
|
|
1805
|
+
message: `unsupported custom tool content part`
|
|
1806
|
+
});
|
|
1807
|
+
return void 0;
|
|
1808
|
+
}
|
|
1794
1809
|
default: {
|
|
1795
1810
|
warnings.push({
|
|
1796
1811
|
type: "other",
|