@ai-sdk/anthropic 3.0.0-beta.29 → 3.0.0-beta.30
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 +6 -0
- package/README.md +1 -1
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +42 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -3
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +41 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +41 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.js
CHANGED
|
@@ -584,7 +584,22 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
584
584
|
allowedTools: import_v43.z.array(import_v43.z.string()).nullish()
|
|
585
585
|
}).nullish()
|
|
586
586
|
})
|
|
587
|
-
).optional()
|
|
587
|
+
).optional(),
|
|
588
|
+
/**
|
|
589
|
+
* Agent Skills configuration. Skills enable Claude to perform specialized tasks
|
|
590
|
+
* like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
|
|
591
|
+
* Requires code execution tool to be enabled.
|
|
592
|
+
*/
|
|
593
|
+
container: import_v43.z.object({
|
|
594
|
+
id: import_v43.z.string().optional(),
|
|
595
|
+
skills: import_v43.z.array(
|
|
596
|
+
import_v43.z.object({
|
|
597
|
+
type: import_v43.z.union([import_v43.z.literal("anthropic"), import_v43.z.literal("custom")]),
|
|
598
|
+
skillId: import_v43.z.string(),
|
|
599
|
+
version: import_v43.z.string().optional()
|
|
600
|
+
})
|
|
601
|
+
).optional()
|
|
602
|
+
}).optional()
|
|
588
603
|
});
|
|
589
604
|
|
|
590
605
|
// src/anthropic-prepare-tools.ts
|
|
@@ -1741,7 +1756,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1741
1756
|
toolChoice,
|
|
1742
1757
|
providerOptions
|
|
1743
1758
|
}) {
|
|
1744
|
-
var _a, _b, _c;
|
|
1759
|
+
var _a, _b, _c, _d;
|
|
1745
1760
|
const warnings = [];
|
|
1746
1761
|
if (frequencyPenalty != null) {
|
|
1747
1762
|
warnings.push({
|
|
@@ -1822,6 +1837,17 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1822
1837
|
} : void 0
|
|
1823
1838
|
}))
|
|
1824
1839
|
},
|
|
1840
|
+
// container with agent skills:
|
|
1841
|
+
...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
|
|
1842
|
+
container: {
|
|
1843
|
+
id: anthropicOptions.container.id,
|
|
1844
|
+
skills: (_d = anthropicOptions.container.skills) == null ? void 0 : _d.map((skill) => ({
|
|
1845
|
+
type: skill.type,
|
|
1846
|
+
skill_id: skill.skillId,
|
|
1847
|
+
version: skill.version
|
|
1848
|
+
}))
|
|
1849
|
+
}
|
|
1850
|
+
},
|
|
1825
1851
|
// prompt:
|
|
1826
1852
|
system: messagesPrompt.system,
|
|
1827
1853
|
messages: messagesPrompt.messages
|
|
@@ -1871,6 +1897,19 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1871
1897
|
if ((anthropicOptions == null ? void 0 : anthropicOptions.mcpServers) && anthropicOptions.mcpServers.length > 0) {
|
|
1872
1898
|
betas.add("mcp-client-2025-04-04");
|
|
1873
1899
|
}
|
|
1900
|
+
if ((anthropicOptions == null ? void 0 : anthropicOptions.container) && anthropicOptions.container.skills && anthropicOptions.container.skills.length > 0) {
|
|
1901
|
+
betas.add("code-execution-2025-08-25");
|
|
1902
|
+
betas.add("skills-2025-10-02");
|
|
1903
|
+
betas.add("files-api-2025-04-14");
|
|
1904
|
+
if (!(tools == null ? void 0 : tools.some(
|
|
1905
|
+
(tool) => tool.type === "provider-defined" && tool.id === "anthropic.code_execution_20250825"
|
|
1906
|
+
))) {
|
|
1907
|
+
warnings.push({
|
|
1908
|
+
type: "other",
|
|
1909
|
+
message: "code execution tool is required when using skills"
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1874
1913
|
const {
|
|
1875
1914
|
tools: anthropicTools2,
|
|
1876
1915
|
toolChoice: anthropicToolChoice,
|