@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.
@@ -653,6 +653,20 @@ var anthropicProviderOptions = z3.object({
653
653
  type: z3.literal("ephemeral"),
654
654
  ttl: z3.union([z3.literal("5m"), z3.literal("1h")]).optional()
655
655
  }).optional(),
656
+ /**
657
+ * Metadata to include with the request.
658
+ *
659
+ * See https://platform.claude.com/docs/en/api/messages/create for details.
660
+ */
661
+ metadata: z3.object({
662
+ /**
663
+ * An external identifier for the user associated with the request.
664
+ *
665
+ * Should be a UUID, hash value, or other opaque identifier.
666
+ * Must not contain PII (name, email, phone number, etc.).
667
+ */
668
+ userId: z3.string().optional()
669
+ }).optional(),
656
670
  /**
657
671
  * Agent Skills configuration. Skills enable Claude to perform specialized tasks
658
672
  * like document processing (PPTX, DOCX, PDF, XLSX) and data analysis.
@@ -1955,7 +1969,7 @@ var AnthropicMessagesLanguageModel = class {
1955
1969
  toolChoice,
1956
1970
  providerOptions
1957
1971
  }) {
1958
- var _a, _b, _c, _d, _e, _f;
1972
+ var _a, _b, _c, _d, _e, _f, _g;
1959
1973
  const warnings = [];
1960
1974
  if (frequencyPenalty != null) {
1961
1975
  warnings.push({
@@ -2059,6 +2073,9 @@ var AnthropicMessagesLanguageModel = class {
2059
2073
  ...(anthropicOptions == null ? void 0 : anthropicOptions.cacheControl) && {
2060
2074
  cache_control: anthropicOptions.cacheControl
2061
2075
  },
2076
+ ...((_e = anthropicOptions == null ? void 0 : anthropicOptions.metadata) == null ? void 0 : _e.userId) != null && {
2077
+ metadata: { user_id: anthropicOptions.metadata.userId }
2078
+ },
2062
2079
  // structured output:
2063
2080
  ...useStructuredOutput && (responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null && {
2064
2081
  output_format: {
@@ -2070,7 +2087,7 @@ var AnthropicMessagesLanguageModel = class {
2070
2087
  ...(anthropicOptions == null ? void 0 : anthropicOptions.container) && {
2071
2088
  container: {
2072
2089
  id: anthropicOptions.container.id,
2073
- skills: (_e = anthropicOptions.container.skills) == null ? void 0 : _e.map((skill) => ({
2090
+ skills: (_f = anthropicOptions.container.skills) == null ? void 0 : _f.map((skill) => ({
2074
2091
  type: skill.type,
2075
2092
  skill_id: skill.skillId,
2076
2093
  version: skill.version
@@ -2233,7 +2250,7 @@ var AnthropicMessagesLanguageModel = class {
2233
2250
  ...betas,
2234
2251
  ...toolsBetas,
2235
2252
  ...userSuppliedBetas,
2236
- ...(_f = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _f : []
2253
+ ...(_g = anthropicOptions == null ? void 0 : anthropicOptions.anthropicBeta) != null ? _g : []
2237
2254
  ]),
2238
2255
  usesJsonResponseTool: jsonResponseTool != null
2239
2256
  };