@ai-sdk/anthropic 2.0.70 → 2.0.71
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/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +24 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -4
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +23 -6
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +20 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -5
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -147,6 +147,9 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
147
147
|
type: z.ZodLiteral<"ephemeral">;
|
|
148
148
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"5m">, z.ZodLiteral<"1h">]>>;
|
|
149
149
|
}, z.core.$strip>>;
|
|
150
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
150
153
|
container: z.ZodOptional<z.ZodObject<{
|
|
151
154
|
id: z.ZodOptional<z.ZodString>;
|
|
152
155
|
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
package/dist/index.d.ts
CHANGED
|
@@ -147,6 +147,9 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
147
147
|
type: z.ZodLiteral<"ephemeral">;
|
|
148
148
|
ttl: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"5m">, z.ZodLiteral<"1h">]>>;
|
|
149
149
|
}, z.core.$strip>>;
|
|
150
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
151
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
150
153
|
container: z.ZodOptional<z.ZodObject<{
|
|
151
154
|
id: z.ZodOptional<z.ZodString>;
|
|
152
155
|
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -18,20 +18,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
VERSION: () => VERSION,
|
|
24
24
|
anthropic: () => anthropic,
|
|
25
25
|
createAnthropic: () => createAnthropic
|
|
26
26
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
|
|
29
29
|
// src/anthropic-provider.ts
|
|
30
30
|
var import_provider4 = require("@ai-sdk/provider");
|
|
31
31
|
var import_provider_utils20 = require("@ai-sdk/provider-utils");
|
|
32
32
|
|
|
33
33
|
// src/version.ts
|
|
34
|
-
var VERSION = true ? "2.0.
|
|
34
|
+
var VERSION = true ? "2.0.71" : "0.0.0-test";
|
|
35
35
|
|
|
36
36
|
// src/anthropic-messages-language-model.ts
|
|
37
37
|
var import_provider3 = require("@ai-sdk/provider");
|
|
@@ -673,6 +673,20 @@ var anthropicProviderOptions = import_v43.z.object({
|
|
|
673
673
|
type: import_v43.z.literal("ephemeral"),
|
|
674
674
|
ttl: import_v43.z.union([import_v43.z.literal("5m"), import_v43.z.literal("1h")]).optional()
|
|
675
675
|
}).optional(),
|
|
676
|
+
/**
|
|
677
|
+
* Metadata to include with the request.
|
|
678
|
+
*
|
|
679
|
+
* See https://platform.claude.com/docs/en/api/messages/create for details.
|
|
680
|
+
*/
|
|
681
|
+
metadata: import_v43.z.object({
|
|
682
|
+
/**
|
|
683
|
+
* An external identifier for the user associated with the request.
|
|
684
|
+
*
|
|
685
|
+
* Should be a UUID, hash value, or other opaque identifier.
|
|
686
|
+
* Must not contain PII (name, email, phone number, etc.).
|
|
687
|
+
*/
|
|
688
|
+
userId: import_v43.z.string().optional()
|
|
689
|
+
}).optional(),
|
|
676
690
|
/**
|
|
677
691
|
* Agent Skills configuration. Skills enable Claude to perform specialized tasks
|
|
678
692
|
* like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
|
|
@@ -1951,7 +1965,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
1951
1965
|
toolChoice,
|
|
1952
1966
|
providerOptions
|
|
1953
1967
|
}) {
|
|
1954
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1968
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1955
1969
|
const warnings = [];
|
|
1956
1970
|
if (frequencyPenalty != null) {
|
|
1957
1971
|
warnings.push({
|
|
@@ -2055,6 +2069,9 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2055
2069
|
...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
|
|
2056
2070
|
cache_control: anthropicOptions.cacheControl
|
|
2057
2071
|
},
|
|
2072
|
+
...((_e = anthropicOptions == null ? void 0 : anthropicOptions.metadata) == null ? void 0 : _e.userId) != null && {
|
|
2073
|
+
metadata: { user_id: anthropicOptions.metadata.userId }
|
|
2074
|
+
},
|
|
2058
2075
|
// structured output:
|
|
2059
2076
|
...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
|
|
2060
2077
|
output_format: {
|
|
@@ -2066,7 +2083,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2066
2083
|
...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
|
|
2067
2084
|
container: {
|
|
2068
2085
|
id: anthropicOptions.container.id,
|
|
2069
|
-
skills: (
|
|
2086
|
+
skills: (_f = anthropicOptions.container.skills) == null ? void 0 : _f.map((skill) => ({
|
|
2070
2087
|
type: skill.type,
|
|
2071
2088
|
skill_id: skill.skillId,
|
|
2072
2089
|
version: skill.version
|
|
@@ -2229,7 +2246,7 @@ var AnthropicMessagesLanguageModel = class {
|
|
|
2229
2246
|
...betas,
|
|
2230
2247
|
...toolsBetas,
|
|
2231
2248
|
...userSuppliedBetas,
|
|
2232
|
-
...(
|
|
2249
|
+
...(_g = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _g : []
|
|
2233
2250
|
]),
|
|
2234
2251
|
usesJsonResponseTool: jsonResponseTool != null
|
|
2235
2252
|
};
|