@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/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "@ai-sdk/provider-utils";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = true ? "2.0.70" : "0.0.0-test";
14
+ var VERSION = true ? "2.0.71" : "0.0.0-test";
15
15
 
16
16
  // src/anthropic-messages-language-model.ts
17
17
  import {
@@ -668,6 +668,20 @@ var anthropicProviderOptions = z3.object({
668
668
  type: z3.literal("ephemeral"),
669
669
  ttl: z3.union([z3.literal("5m"), z3.literal("1h")]).optional()
670
670
  }).optional(),
671
+ /**
672
+ * Metadata to include with the request.
673
+ *
674
+ * See https://platform.claude.com/docs/en/api/messages/create for details.
675
+ */
676
+ metadata: z3.object({
677
+ /**
678
+ * An external identifier for the user associated with the request.
679
+ *
680
+ * Should be a UUID, hash value, or other opaque identifier.
681
+ * Must not contain PII (name, email, phone number, etc.).
682
+ */
683
+ userId: z3.string().optional()
684
+ }).optional(),
671
685
  /**
672
686
  * Agent Skills configuration. Skills enable Claude to perform specialized tasks
673
687
  * like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
@@ -1970,7 +1984,7 @@ var AnthropicMessagesLanguageModel = class {
1970
1984
  toolChoice,
1971
1985
  providerOptions
1972
1986
  }) {
1973
- var _a, _b, _c, _d, _e, _f;
1987
+ var _a, _b, _c, _d, _e, _f, _g;
1974
1988
  const warnings = [];
1975
1989
  if (frequencyPenalty != null) {
1976
1990
  warnings.push({
@@ -2074,6 +2088,9 @@ var AnthropicMessagesLanguageModel = class {
2074
2088
  ...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
2075
2089
  cache_control: anthropicOptions.cacheControl
2076
2090
  },
2091
+ ...((_e = anthropicOptions == null ? void 0 : anthropicOptions.metadata) == null ? void 0 : _e.userId) != null && {
2092
+ metadata: { user_id: anthropicOptions.metadata.userId }
2093
+ },
2077
2094
  // structured output:
2078
2095
  ...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
2079
2096
  output_format: {
@@ -2085,7 +2102,7 @@ var AnthropicMessagesLanguageModel = class {
2085
2102
  ...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
2086
2103
  container: {
2087
2104
  id: anthropicOptions.container.id,
2088
- skills: (_e = anthropicOptions.container.skills) == null ? void 0 : _e.map((skill) => ({
2105
+ skills: (_f = anthropicOptions.container.skills) == null ? void 0 : _f.map((skill) => ({
2089
2106
  type: skill.type,
2090
2107
  skill_id: skill.skillId,
2091
2108
  version: skill.version
@@ -2248,7 +2265,7 @@ var AnthropicMessagesLanguageModel = class {
2248
2265
  ...betas,
2249
2266
  ...toolsBetas,
2250
2267
  ...userSuppliedBetas,
2251
- ...(_f = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _f : []
2268
+ ...(_g = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _g : []
2252
2269
  ]),
2253
2270
  usesJsonResponseTool: jsonResponseTool != null
2254
2271
  };