@ai-sdk/anthropic 2.0.0-canary.10 → 2.0.0-canary.12

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.js CHANGED
@@ -32,7 +32,7 @@ var import_provider_utils4 = require("@ai-sdk/provider-utils");
32
32
  // src/anthropic-messages-language-model.ts
33
33
  var import_provider3 = require("@ai-sdk/provider");
34
34
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
35
- var import_zod2 = require("zod");
35
+ var import_zod3 = require("zod");
36
36
 
37
37
  // src/anthropic-error.ts
38
38
  var import_provider_utils = require("@ai-sdk/provider-utils");
@@ -49,6 +49,21 @@ var anthropicFailedResponseHandler = (0, import_provider_utils.createJsonErrorRe
49
49
  errorToMessage: (data) => data.error.message
50
50
  });
51
51
 
52
+ // src/anthropic-messages-options.ts
53
+ var import_zod2 = require("zod");
54
+ var anthropicProviderOptions = import_zod2.z.object({
55
+ /**
56
+ Include reasoning content in requests sent to the model. Defaults to `true`.
57
+
58
+ If you are experiencing issues with the model handling requests involving
59
+ */
60
+ sendReasoning: import_zod2.z.boolean().optional(),
61
+ thinking: import_zod2.z.object({
62
+ type: import_zod2.z.union([import_zod2.z.literal("enabled"), import_zod2.z.literal("disabled")]),
63
+ budgetTokens: import_zod2.z.number().optional()
64
+ }).optional()
65
+ });
66
+
52
67
  // src/anthropic-prepare-tools.ts
53
68
  var import_provider = require("@ai-sdk/provider");
54
69
  function prepareTools({
@@ -176,7 +191,7 @@ function prepareTools({
176
191
  // src/convert-to-anthropic-messages-prompt.ts
177
192
  var import_provider2 = require("@ai-sdk/provider");
178
193
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
179
- function convertToAnthropicMessagesPrompt({
194
+ async function convertToAnthropicMessagesPrompt({
180
195
  prompt,
181
196
  sendReasoning,
182
197
  warnings
@@ -339,12 +354,37 @@ function convertToAnthropicMessagesPrompt({
339
354
  }
340
355
  case "reasoning": {
341
356
  if (sendReasoning) {
342
- anthropicContent.push({
343
- type: "thinking",
344
- thinking: part.text,
345
- signature: part.signature,
346
- cache_control: cacheControl
357
+ const reasoningMetadata = await (0, import_provider_utils2.parseProviderOptions)({
358
+ provider: "anthropic",
359
+ providerOptions: part.providerOptions,
360
+ schema: anthropicReasoningMetadataSchema
347
361
  });
362
+ if (reasoningMetadata != null) {
363
+ if (reasoningMetadata.signature != null) {
364
+ anthropicContent.push({
365
+ type: "thinking",
366
+ thinking: part.text,
367
+ signature: reasoningMetadata.signature,
368
+ cache_control: cacheControl
369
+ });
370
+ } else if (reasoningMetadata.redactedData != null) {
371
+ anthropicContent.push({
372
+ type: "redacted_thinking",
373
+ data: reasoningMetadata.redactedData,
374
+ cache_control: cacheControl
375
+ });
376
+ } else {
377
+ warnings.push({
378
+ type: "other",
379
+ message: "unsupported reasoning metadata"
380
+ });
381
+ }
382
+ } else {
383
+ warnings.push({
384
+ type: "other",
385
+ message: "unsupported reasoning metadata"
386
+ });
387
+ }
348
388
  } else {
349
389
  warnings.push({
350
390
  type: "other",
@@ -353,14 +393,6 @@ function convertToAnthropicMessagesPrompt({
353
393
  }
354
394
  break;
355
395
  }
356
- case "redacted-reasoning": {
357
- anthropicContent.push({
358
- type: "redacted_thinking",
359
- data: part.data,
360
- cache_control: cacheControl
361
- });
362
- break;
363
- }
364
396
  case "tool-call": {
365
397
  anthropicContent.push({
366
398
  type: "tool_use",
@@ -452,10 +484,9 @@ function mapAnthropicStopReason(finishReason) {
452
484
 
453
485
  // src/anthropic-messages-language-model.ts
454
486
  var AnthropicMessagesLanguageModel = class {
455
- constructor(modelId, settings, config) {
487
+ constructor(modelId, config) {
456
488
  this.specificationVersion = "v2";
457
489
  this.modelId = modelId;
458
- this.settings = settings;
459
490
  this.config = config;
460
491
  }
461
492
  supportsUrl(url) {
@@ -511,15 +542,15 @@ var AnthropicMessagesLanguageModel = class {
511
542
  details: "JSON response format is not supported."
512
543
  });
513
544
  }
514
- const { prompt: messagesPrompt, betas: messagesBetas } = convertToAnthropicMessagesPrompt({
515
- prompt,
516
- sendReasoning: (_a = this.settings.sendReasoning) != null ? _a : true,
517
- warnings
518
- });
519
- const anthropicOptions = (0, import_provider_utils3.parseProviderOptions)({
545
+ const anthropicOptions = await (0, import_provider_utils3.parseProviderOptions)({
520
546
  provider: "anthropic",
521
547
  providerOptions,
522
- schema: anthropicProviderOptionsSchema
548
+ schema: anthropicProviderOptions
549
+ });
550
+ const { prompt: messagesPrompt, betas: messagesBetas } = await convertToAnthropicMessagesPrompt({
551
+ prompt,
552
+ sendReasoning: (_a = anthropicOptions == null ? void 0 : anthropicOptions.sendReasoning) != null ? _a : true,
553
+ warnings
523
554
  });
524
555
  const isThinking = ((_b = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _b.type) === "enabled";
525
556
  const thinkingBudget = (_c = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _c.budgetTokens;
@@ -634,21 +665,24 @@ var AnthropicMessagesLanguageModel = class {
634
665
  case "thinking": {
635
666
  content.push({
636
667
  type: "reasoning",
637
- reasoningType: "text",
638
- text: part.thinking
639
- });
640
- content.push({
641
- type: "reasoning",
642
- reasoningType: "signature",
643
- signature: part.signature
668
+ text: part.thinking,
669
+ providerMetadata: {
670
+ anthropic: {
671
+ signature: part.signature
672
+ }
673
+ }
644
674
  });
645
675
  break;
646
676
  }
647
677
  case "redacted_thinking": {
648
678
  content.push({
649
679
  type: "reasoning",
650
- reasoningType: "redacted",
651
- data: part.data
680
+ text: "",
681
+ providerMetadata: {
682
+ anthropic: {
683
+ redactedData: part.data
684
+ }
685
+ }
652
686
  });
653
687
  break;
654
688
  }
@@ -737,9 +771,14 @@ var AnthropicMessagesLanguageModel = class {
737
771
  case "redacted_thinking": {
738
772
  controller.enqueue({
739
773
  type: "reasoning",
740
- reasoningType: "redacted",
741
- data: value.content_block.data
774
+ text: "",
775
+ providerMetadata: {
776
+ anthropic: {
777
+ redactedData: value.content_block.data
778
+ }
779
+ }
742
780
  });
781
+ controller.enqueue({ type: "reasoning-part-finish" });
743
782
  return;
744
783
  }
745
784
  case "tool_use": {
@@ -786,7 +825,6 @@ var AnthropicMessagesLanguageModel = class {
786
825
  case "thinking_delta": {
787
826
  controller.enqueue({
788
827
  type: "reasoning",
789
- reasoningType: "text",
790
828
  text: value.delta.thinking
791
829
  });
792
830
  return;
@@ -795,9 +833,14 @@ var AnthropicMessagesLanguageModel = class {
795
833
  if (blockType === "thinking") {
796
834
  controller.enqueue({
797
835
  type: "reasoning",
798
- reasoningType: "signature",
799
- signature: value.delta.signature
836
+ text: "",
837
+ providerMetadata: {
838
+ anthropic: {
839
+ signature: value.delta.signature
840
+ }
841
+ }
800
842
  });
843
+ controller.enqueue({ type: "reasoning-part-finish" });
801
844
  }
802
845
  return;
803
846
  }
@@ -868,135 +911,133 @@ var AnthropicMessagesLanguageModel = class {
868
911
  };
869
912
  }
870
913
  };
871
- var anthropicMessagesResponseSchema = import_zod2.z.object({
872
- type: import_zod2.z.literal("message"),
873
- id: import_zod2.z.string().nullish(),
874
- model: import_zod2.z.string().nullish(),
875
- content: import_zod2.z.array(
876
- import_zod2.z.discriminatedUnion("type", [
877
- import_zod2.z.object({
878
- type: import_zod2.z.literal("text"),
879
- text: import_zod2.z.string()
914
+ var anthropicMessagesResponseSchema = import_zod3.z.object({
915
+ type: import_zod3.z.literal("message"),
916
+ id: import_zod3.z.string().nullish(),
917
+ model: import_zod3.z.string().nullish(),
918
+ content: import_zod3.z.array(
919
+ import_zod3.z.discriminatedUnion("type", [
920
+ import_zod3.z.object({
921
+ type: import_zod3.z.literal("text"),
922
+ text: import_zod3.z.string()
880
923
  }),
881
- import_zod2.z.object({
882
- type: import_zod2.z.literal("thinking"),
883
- thinking: import_zod2.z.string(),
884
- signature: import_zod2.z.string()
924
+ import_zod3.z.object({
925
+ type: import_zod3.z.literal("thinking"),
926
+ thinking: import_zod3.z.string(),
927
+ signature: import_zod3.z.string()
885
928
  }),
886
- import_zod2.z.object({
887
- type: import_zod2.z.literal("redacted_thinking"),
888
- data: import_zod2.z.string()
929
+ import_zod3.z.object({
930
+ type: import_zod3.z.literal("redacted_thinking"),
931
+ data: import_zod3.z.string()
889
932
  }),
890
- import_zod2.z.object({
891
- type: import_zod2.z.literal("tool_use"),
892
- id: import_zod2.z.string(),
893
- name: import_zod2.z.string(),
894
- input: import_zod2.z.unknown()
933
+ import_zod3.z.object({
934
+ type: import_zod3.z.literal("tool_use"),
935
+ id: import_zod3.z.string(),
936
+ name: import_zod3.z.string(),
937
+ input: import_zod3.z.unknown()
895
938
  })
896
939
  ])
897
940
  ),
898
- stop_reason: import_zod2.z.string().nullish(),
899
- usage: import_zod2.z.object({
900
- input_tokens: import_zod2.z.number(),
901
- output_tokens: import_zod2.z.number(),
902
- cache_creation_input_tokens: import_zod2.z.number().nullish(),
903
- cache_read_input_tokens: import_zod2.z.number().nullish()
941
+ stop_reason: import_zod3.z.string().nullish(),
942
+ usage: import_zod3.z.object({
943
+ input_tokens: import_zod3.z.number(),
944
+ output_tokens: import_zod3.z.number(),
945
+ cache_creation_input_tokens: import_zod3.z.number().nullish(),
946
+ cache_read_input_tokens: import_zod3.z.number().nullish()
904
947
  })
905
948
  });
906
- var anthropicMessagesChunkSchema = import_zod2.z.discriminatedUnion("type", [
907
- import_zod2.z.object({
908
- type: import_zod2.z.literal("message_start"),
909
- message: import_zod2.z.object({
910
- id: import_zod2.z.string().nullish(),
911
- model: import_zod2.z.string().nullish(),
912
- usage: import_zod2.z.object({
913
- input_tokens: import_zod2.z.number(),
914
- output_tokens: import_zod2.z.number(),
915
- cache_creation_input_tokens: import_zod2.z.number().nullish(),
916
- cache_read_input_tokens: import_zod2.z.number().nullish()
949
+ var anthropicMessagesChunkSchema = import_zod3.z.discriminatedUnion("type", [
950
+ import_zod3.z.object({
951
+ type: import_zod3.z.literal("message_start"),
952
+ message: import_zod3.z.object({
953
+ id: import_zod3.z.string().nullish(),
954
+ model: import_zod3.z.string().nullish(),
955
+ usage: import_zod3.z.object({
956
+ input_tokens: import_zod3.z.number(),
957
+ output_tokens: import_zod3.z.number(),
958
+ cache_creation_input_tokens: import_zod3.z.number().nullish(),
959
+ cache_read_input_tokens: import_zod3.z.number().nullish()
917
960
  })
918
961
  })
919
962
  }),
920
- import_zod2.z.object({
921
- type: import_zod2.z.literal("content_block_start"),
922
- index: import_zod2.z.number(),
923
- content_block: import_zod2.z.discriminatedUnion("type", [
924
- import_zod2.z.object({
925
- type: import_zod2.z.literal("text"),
926
- text: import_zod2.z.string()
963
+ import_zod3.z.object({
964
+ type: import_zod3.z.literal("content_block_start"),
965
+ index: import_zod3.z.number(),
966
+ content_block: import_zod3.z.discriminatedUnion("type", [
967
+ import_zod3.z.object({
968
+ type: import_zod3.z.literal("text"),
969
+ text: import_zod3.z.string()
927
970
  }),
928
- import_zod2.z.object({
929
- type: import_zod2.z.literal("thinking"),
930
- thinking: import_zod2.z.string()
971
+ import_zod3.z.object({
972
+ type: import_zod3.z.literal("thinking"),
973
+ thinking: import_zod3.z.string()
931
974
  }),
932
- import_zod2.z.object({
933
- type: import_zod2.z.literal("tool_use"),
934
- id: import_zod2.z.string(),
935
- name: import_zod2.z.string()
975
+ import_zod3.z.object({
976
+ type: import_zod3.z.literal("tool_use"),
977
+ id: import_zod3.z.string(),
978
+ name: import_zod3.z.string()
936
979
  }),
937
- import_zod2.z.object({
938
- type: import_zod2.z.literal("redacted_thinking"),
939
- data: import_zod2.z.string()
980
+ import_zod3.z.object({
981
+ type: import_zod3.z.literal("redacted_thinking"),
982
+ data: import_zod3.z.string()
940
983
  })
941
984
  ])
942
985
  }),
943
- import_zod2.z.object({
944
- type: import_zod2.z.literal("content_block_delta"),
945
- index: import_zod2.z.number(),
946
- delta: import_zod2.z.discriminatedUnion("type", [
947
- import_zod2.z.object({
948
- type: import_zod2.z.literal("input_json_delta"),
949
- partial_json: import_zod2.z.string()
986
+ import_zod3.z.object({
987
+ type: import_zod3.z.literal("content_block_delta"),
988
+ index: import_zod3.z.number(),
989
+ delta: import_zod3.z.discriminatedUnion("type", [
990
+ import_zod3.z.object({
991
+ type: import_zod3.z.literal("input_json_delta"),
992
+ partial_json: import_zod3.z.string()
950
993
  }),
951
- import_zod2.z.object({
952
- type: import_zod2.z.literal("text_delta"),
953
- text: import_zod2.z.string()
994
+ import_zod3.z.object({
995
+ type: import_zod3.z.literal("text_delta"),
996
+ text: import_zod3.z.string()
954
997
  }),
955
- import_zod2.z.object({
956
- type: import_zod2.z.literal("thinking_delta"),
957
- thinking: import_zod2.z.string()
998
+ import_zod3.z.object({
999
+ type: import_zod3.z.literal("thinking_delta"),
1000
+ thinking: import_zod3.z.string()
958
1001
  }),
959
- import_zod2.z.object({
960
- type: import_zod2.z.literal("signature_delta"),
961
- signature: import_zod2.z.string()
1002
+ import_zod3.z.object({
1003
+ type: import_zod3.z.literal("signature_delta"),
1004
+ signature: import_zod3.z.string()
962
1005
  })
963
1006
  ])
964
1007
  }),
965
- import_zod2.z.object({
966
- type: import_zod2.z.literal("content_block_stop"),
967
- index: import_zod2.z.number()
1008
+ import_zod3.z.object({
1009
+ type: import_zod3.z.literal("content_block_stop"),
1010
+ index: import_zod3.z.number()
968
1011
  }),
969
- import_zod2.z.object({
970
- type: import_zod2.z.literal("error"),
971
- error: import_zod2.z.object({
972
- type: import_zod2.z.string(),
973
- message: import_zod2.z.string()
1012
+ import_zod3.z.object({
1013
+ type: import_zod3.z.literal("error"),
1014
+ error: import_zod3.z.object({
1015
+ type: import_zod3.z.string(),
1016
+ message: import_zod3.z.string()
974
1017
  })
975
1018
  }),
976
- import_zod2.z.object({
977
- type: import_zod2.z.literal("message_delta"),
978
- delta: import_zod2.z.object({ stop_reason: import_zod2.z.string().nullish() }),
979
- usage: import_zod2.z.object({ output_tokens: import_zod2.z.number() })
1019
+ import_zod3.z.object({
1020
+ type: import_zod3.z.literal("message_delta"),
1021
+ delta: import_zod3.z.object({ stop_reason: import_zod3.z.string().nullish() }),
1022
+ usage: import_zod3.z.object({ output_tokens: import_zod3.z.number() })
980
1023
  }),
981
- import_zod2.z.object({
982
- type: import_zod2.z.literal("message_stop")
1024
+ import_zod3.z.object({
1025
+ type: import_zod3.z.literal("message_stop")
983
1026
  }),
984
- import_zod2.z.object({
985
- type: import_zod2.z.literal("ping")
1027
+ import_zod3.z.object({
1028
+ type: import_zod3.z.literal("ping")
986
1029
  })
987
1030
  ]);
988
- var anthropicProviderOptionsSchema = import_zod2.z.object({
989
- thinking: import_zod2.z.object({
990
- type: import_zod2.z.union([import_zod2.z.literal("enabled"), import_zod2.z.literal("disabled")]),
991
- budgetTokens: import_zod2.z.number().optional()
992
- }).optional()
1031
+ var anthropicReasoningMetadataSchema = import_zod3.z.object({
1032
+ signature: import_zod3.z.string().optional(),
1033
+ redactedData: import_zod3.z.string().optional()
993
1034
  });
994
1035
 
995
1036
  // src/anthropic-tools.ts
996
- var import_zod3 = require("zod");
997
- var Bash20241022Parameters = import_zod3.z.object({
998
- command: import_zod3.z.string(),
999
- restart: import_zod3.z.boolean().optional()
1037
+ var import_zod4 = require("zod");
1038
+ var Bash20241022Parameters = import_zod4.z.object({
1039
+ command: import_zod4.z.string(),
1040
+ restart: import_zod4.z.boolean().optional()
1000
1041
  });
1001
1042
  function bashTool_20241022(options = {}) {
1002
1043
  return {
@@ -1008,9 +1049,9 @@ function bashTool_20241022(options = {}) {
1008
1049
  experimental_toToolResultContent: options.experimental_toToolResultContent
1009
1050
  };
1010
1051
  }
1011
- var Bash20250124Parameters = import_zod3.z.object({
1012
- command: import_zod3.z.string(),
1013
- restart: import_zod3.z.boolean().optional()
1052
+ var Bash20250124Parameters = import_zod4.z.object({
1053
+ command: import_zod4.z.string(),
1054
+ restart: import_zod4.z.boolean().optional()
1014
1055
  });
1015
1056
  function bashTool_20250124(options = {}) {
1016
1057
  return {
@@ -1022,14 +1063,14 @@ function bashTool_20250124(options = {}) {
1022
1063
  experimental_toToolResultContent: options.experimental_toToolResultContent
1023
1064
  };
1024
1065
  }
1025
- var TextEditor20241022Parameters = import_zod3.z.object({
1026
- command: import_zod3.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1027
- path: import_zod3.z.string(),
1028
- file_text: import_zod3.z.string().optional(),
1029
- insert_line: import_zod3.z.number().int().optional(),
1030
- new_str: import_zod3.z.string().optional(),
1031
- old_str: import_zod3.z.string().optional(),
1032
- view_range: import_zod3.z.array(import_zod3.z.number().int()).optional()
1066
+ var TextEditor20241022Parameters = import_zod4.z.object({
1067
+ command: import_zod4.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1068
+ path: import_zod4.z.string(),
1069
+ file_text: import_zod4.z.string().optional(),
1070
+ insert_line: import_zod4.z.number().int().optional(),
1071
+ new_str: import_zod4.z.string().optional(),
1072
+ old_str: import_zod4.z.string().optional(),
1073
+ view_range: import_zod4.z.array(import_zod4.z.number().int()).optional()
1033
1074
  });
1034
1075
  function textEditorTool_20241022(options = {}) {
1035
1076
  return {
@@ -1041,14 +1082,14 @@ function textEditorTool_20241022(options = {}) {
1041
1082
  experimental_toToolResultContent: options.experimental_toToolResultContent
1042
1083
  };
1043
1084
  }
1044
- var TextEditor20250124Parameters = import_zod3.z.object({
1045
- command: import_zod3.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1046
- path: import_zod3.z.string(),
1047
- file_text: import_zod3.z.string().optional(),
1048
- insert_line: import_zod3.z.number().int().optional(),
1049
- new_str: import_zod3.z.string().optional(),
1050
- old_str: import_zod3.z.string().optional(),
1051
- view_range: import_zod3.z.array(import_zod3.z.number().int()).optional()
1085
+ var TextEditor20250124Parameters = import_zod4.z.object({
1086
+ command: import_zod4.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1087
+ path: import_zod4.z.string(),
1088
+ file_text: import_zod4.z.string().optional(),
1089
+ insert_line: import_zod4.z.number().int().optional(),
1090
+ new_str: import_zod4.z.string().optional(),
1091
+ old_str: import_zod4.z.string().optional(),
1092
+ view_range: import_zod4.z.array(import_zod4.z.number().int()).optional()
1052
1093
  });
1053
1094
  function textEditorTool_20250124(options = {}) {
1054
1095
  return {
@@ -1060,8 +1101,8 @@ function textEditorTool_20250124(options = {}) {
1060
1101
  experimental_toToolResultContent: options.experimental_toToolResultContent
1061
1102
  };
1062
1103
  }
1063
- var Computer20241022Parameters = import_zod3.z.object({
1064
- action: import_zod3.z.enum([
1104
+ var Computer20241022Parameters = import_zod4.z.object({
1105
+ action: import_zod4.z.enum([
1065
1106
  "key",
1066
1107
  "type",
1067
1108
  "mouse_move",
@@ -1073,8 +1114,8 @@ var Computer20241022Parameters = import_zod3.z.object({
1073
1114
  "screenshot",
1074
1115
  "cursor_position"
1075
1116
  ]),
1076
- coordinate: import_zod3.z.array(import_zod3.z.number().int()).optional(),
1077
- text: import_zod3.z.string().optional()
1117
+ coordinate: import_zod4.z.array(import_zod4.z.number().int()).optional(),
1118
+ text: import_zod4.z.string().optional()
1078
1119
  });
1079
1120
  function computerTool_20241022(options) {
1080
1121
  return {
@@ -1090,8 +1131,8 @@ function computerTool_20241022(options) {
1090
1131
  experimental_toToolResultContent: options.experimental_toToolResultContent
1091
1132
  };
1092
1133
  }
1093
- var Computer20250124Parameters = import_zod3.z.object({
1094
- action: import_zod3.z.enum([
1134
+ var Computer20250124Parameters = import_zod4.z.object({
1135
+ action: import_zod4.z.enum([
1095
1136
  "key",
1096
1137
  "hold_key",
1097
1138
  "type",
@@ -1109,12 +1150,12 @@ var Computer20250124Parameters = import_zod3.z.object({
1109
1150
  "wait",
1110
1151
  "screenshot"
1111
1152
  ]),
1112
- coordinate: import_zod3.z.tuple([import_zod3.z.number().int(), import_zod3.z.number().int()]).optional(),
1113
- duration: import_zod3.z.number().optional(),
1114
- scroll_amount: import_zod3.z.number().optional(),
1115
- scroll_direction: import_zod3.z.enum(["up", "down", "left", "right"]).optional(),
1116
- start_coordinate: import_zod3.z.tuple([import_zod3.z.number().int(), import_zod3.z.number().int()]).optional(),
1117
- text: import_zod3.z.string().optional()
1153
+ coordinate: import_zod4.z.tuple([import_zod4.z.number().int(), import_zod4.z.number().int()]).optional(),
1154
+ duration: import_zod4.z.number().optional(),
1155
+ scroll_amount: import_zod4.z.number().optional(),
1156
+ scroll_direction: import_zod4.z.enum(["up", "down", "left", "right"]).optional(),
1157
+ start_coordinate: import_zod4.z.tuple([import_zod4.z.number().int(), import_zod4.z.number().int()]).optional(),
1158
+ text: import_zod4.z.string().optional()
1118
1159
  });
1119
1160
  function computerTool_20250124(options) {
1120
1161
  return {
@@ -1152,7 +1193,7 @@ function createAnthropic(options = {}) {
1152
1193
  }),
1153
1194
  ...options.headers
1154
1195
  });
1155
- const createChatModel = (modelId, settings = {}) => new AnthropicMessagesLanguageModel(modelId, settings, {
1196
+ const createChatModel = (modelId) => new AnthropicMessagesLanguageModel(modelId, {
1156
1197
  provider: "anthropic.messages",
1157
1198
  baseURL,
1158
1199
  headers: getHeaders,
@@ -1161,13 +1202,13 @@ function createAnthropic(options = {}) {
1161
1202
  "image/*": [/^https?:\/\/.*$/]
1162
1203
  })
1163
1204
  });
1164
- const provider = function(modelId, settings) {
1205
+ const provider = function(modelId) {
1165
1206
  if (new.target) {
1166
1207
  throw new Error(
1167
1208
  "The Anthropic model function cannot be called with the new keyword."
1168
1209
  );
1169
1210
  }
1170
- return createChatModel(modelId, settings);
1211
+ return createChatModel(modelId);
1171
1212
  };
1172
1213
  provider.languageModel = createChatModel;
1173
1214
  provider.chat = createChatModel;