@ai-sdk/anthropic 2.0.0-canary.11 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @ai-sdk/anthropic
2
2
 
3
+ ## 2.0.0-canary.12
4
+
5
+ ### Patch Changes
6
+
7
+ - 5c9eec4: chore(providers/anthropic): switch to providerOptions
8
+ - Updated dependencies [9bf7291]
9
+ - Updated dependencies [4617fab]
10
+ - Updated dependencies [e030615]
11
+ - @ai-sdk/provider@2.0.0-canary.11
12
+ - @ai-sdk/provider-utils@3.0.0-canary.12
13
+
3
14
  ## 2.0.0-canary.11
4
15
 
5
16
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3,25 +3,13 @@ import { ProviderV2, LanguageModelV2 } from '@ai-sdk/provider';
3
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
5
  type AnthropicMessagesModelId = 'claude-3-7-sonnet-20250219' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
6
- interface AnthropicMessagesSettings {
7
- /**
8
- Enable Anthropic cache control. This will allow you to use provider-specific
9
- `cacheControl` metadata.
10
-
11
- @deprecated cache control is now enabled by default (meaning you are able to
12
- optionally mark content for caching) and this setting is no longer needed.
13
- */
14
- cacheControl?: boolean;
6
+ declare const anthropicProviderOptions: z.ZodObject<{
15
7
  /**
16
8
  Include reasoning content in requests sent to the model. Defaults to `true`.
17
9
 
18
10
  If you are experiencing issues with the model handling requests involving
19
- reasoning content, you can set this to `false` to omit them from the request.
20
11
  */
21
- sendReasoning?: boolean;
22
- }
23
-
24
- declare const anthropicProviderOptionsSchema: z.ZodObject<{
12
+ sendReasoning: z.ZodOptional<z.ZodBoolean>;
25
13
  thinking: z.ZodOptional<z.ZodObject<{
26
14
  type: z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>;
27
15
  budgetTokens: z.ZodOptional<z.ZodNumber>;
@@ -33,17 +21,19 @@ declare const anthropicProviderOptionsSchema: z.ZodObject<{
33
21
  budgetTokens?: number | undefined;
34
22
  }>>;
35
23
  }, "strip", z.ZodTypeAny, {
24
+ sendReasoning?: boolean | undefined;
36
25
  thinking?: {
37
26
  type: "enabled" | "disabled";
38
27
  budgetTokens?: number | undefined;
39
28
  } | undefined;
40
29
  }, {
30
+ sendReasoning?: boolean | undefined;
41
31
  thinking?: {
42
32
  type: "enabled" | "disabled";
43
33
  budgetTokens?: number | undefined;
44
34
  } | undefined;
45
35
  }>;
46
- type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptionsSchema>;
36
+ type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
47
37
 
48
38
  type ExecuteFunction<PARAMETERS, RESULT> = undefined | ((args: PARAMETERS, options: {
49
39
  abortSignal?: AbortSignal;
@@ -444,19 +434,19 @@ interface AnthropicProvider extends ProviderV2 {
444
434
  /**
445
435
  Creates a model for text generation.
446
436
  */
447
- (modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
437
+ (modelId: AnthropicMessagesModelId): LanguageModelV2;
448
438
  /**
449
439
  Creates a model for text generation.
450
440
  */
451
- languageModel(modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
441
+ languageModel(modelId: AnthropicMessagesModelId): LanguageModelV2;
452
442
  /**
453
443
  @deprecated Use `.languageModel()` instead.
454
444
  */
455
- chat(modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
445
+ chat(modelId: AnthropicMessagesModelId): LanguageModelV2;
456
446
  /**
457
447
  @deprecated Use `.languageModel()` instead.
458
448
  */
459
- messages(modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
449
+ messages(modelId: AnthropicMessagesModelId): LanguageModelV2;
460
450
  /**
461
451
  Anthropic-specific computer use tool.
462
452
  */
package/dist/index.d.ts CHANGED
@@ -3,25 +3,13 @@ import { ProviderV2, LanguageModelV2 } from '@ai-sdk/provider';
3
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
4
4
 
5
5
  type AnthropicMessagesModelId = 'claude-3-7-sonnet-20250219' | 'claude-3-5-sonnet-latest' | 'claude-3-5-sonnet-20241022' | 'claude-3-5-sonnet-20240620' | 'claude-3-5-haiku-latest' | 'claude-3-5-haiku-20241022' | 'claude-3-opus-latest' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307' | (string & {});
6
- interface AnthropicMessagesSettings {
7
- /**
8
- Enable Anthropic cache control. This will allow you to use provider-specific
9
- `cacheControl` metadata.
10
-
11
- @deprecated cache control is now enabled by default (meaning you are able to
12
- optionally mark content for caching) and this setting is no longer needed.
13
- */
14
- cacheControl?: boolean;
6
+ declare const anthropicProviderOptions: z.ZodObject<{
15
7
  /**
16
8
  Include reasoning content in requests sent to the model. Defaults to `true`.
17
9
 
18
10
  If you are experiencing issues with the model handling requests involving
19
- reasoning content, you can set this to `false` to omit them from the request.
20
11
  */
21
- sendReasoning?: boolean;
22
- }
23
-
24
- declare const anthropicProviderOptionsSchema: z.ZodObject<{
12
+ sendReasoning: z.ZodOptional<z.ZodBoolean>;
25
13
  thinking: z.ZodOptional<z.ZodObject<{
26
14
  type: z.ZodUnion<[z.ZodLiteral<"enabled">, z.ZodLiteral<"disabled">]>;
27
15
  budgetTokens: z.ZodOptional<z.ZodNumber>;
@@ -33,17 +21,19 @@ declare const anthropicProviderOptionsSchema: z.ZodObject<{
33
21
  budgetTokens?: number | undefined;
34
22
  }>>;
35
23
  }, "strip", z.ZodTypeAny, {
24
+ sendReasoning?: boolean | undefined;
36
25
  thinking?: {
37
26
  type: "enabled" | "disabled";
38
27
  budgetTokens?: number | undefined;
39
28
  } | undefined;
40
29
  }, {
30
+ sendReasoning?: boolean | undefined;
41
31
  thinking?: {
42
32
  type: "enabled" | "disabled";
43
33
  budgetTokens?: number | undefined;
44
34
  } | undefined;
45
35
  }>;
46
- type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptionsSchema>;
36
+ type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
47
37
 
48
38
  type ExecuteFunction<PARAMETERS, RESULT> = undefined | ((args: PARAMETERS, options: {
49
39
  abortSignal?: AbortSignal;
@@ -444,19 +434,19 @@ interface AnthropicProvider extends ProviderV2 {
444
434
  /**
445
435
  Creates a model for text generation.
446
436
  */
447
- (modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
437
+ (modelId: AnthropicMessagesModelId): LanguageModelV2;
448
438
  /**
449
439
  Creates a model for text generation.
450
440
  */
451
- languageModel(modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
441
+ languageModel(modelId: AnthropicMessagesModelId): LanguageModelV2;
452
442
  /**
453
443
  @deprecated Use `.languageModel()` instead.
454
444
  */
455
- chat(modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
445
+ chat(modelId: AnthropicMessagesModelId): LanguageModelV2;
456
446
  /**
457
447
  @deprecated Use `.languageModel()` instead.
458
448
  */
459
- messages(modelId: AnthropicMessagesModelId, settings?: AnthropicMessagesSettings): LanguageModelV2;
449
+ messages(modelId: AnthropicMessagesModelId): LanguageModelV2;
460
450
  /**
461
451
  Anthropic-specific computer use tool.
462
452
  */
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({
@@ -469,10 +484,9 @@ function mapAnthropicStopReason(finishReason) {
469
484
 
470
485
  // src/anthropic-messages-language-model.ts
471
486
  var AnthropicMessagesLanguageModel = class {
472
- constructor(modelId, settings, config) {
487
+ constructor(modelId, config) {
473
488
  this.specificationVersion = "v2";
474
489
  this.modelId = modelId;
475
- this.settings = settings;
476
490
  this.config = config;
477
491
  }
478
492
  supportsUrl(url) {
@@ -528,15 +542,15 @@ var AnthropicMessagesLanguageModel = class {
528
542
  details: "JSON response format is not supported."
529
543
  });
530
544
  }
531
- const { prompt: messagesPrompt, betas: messagesBetas } = await convertToAnthropicMessagesPrompt({
532
- prompt,
533
- sendReasoning: (_a = this.settings.sendReasoning) != null ? _a : true,
534
- warnings
535
- });
536
545
  const anthropicOptions = await (0, import_provider_utils3.parseProviderOptions)({
537
546
  provider: "anthropic",
538
547
  providerOptions,
539
- 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
540
554
  });
541
555
  const isThinking = ((_b = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _b.type) === "enabled";
542
556
  const thinkingBudget = (_c = anthropicOptions == null ? void 0 : anthropicOptions.thinking) == null ? void 0 : _c.budgetTokens;
@@ -897,139 +911,133 @@ var AnthropicMessagesLanguageModel = class {
897
911
  };
898
912
  }
899
913
  };
900
- var anthropicMessagesResponseSchema = import_zod2.z.object({
901
- type: import_zod2.z.literal("message"),
902
- id: import_zod2.z.string().nullish(),
903
- model: import_zod2.z.string().nullish(),
904
- content: import_zod2.z.array(
905
- import_zod2.z.discriminatedUnion("type", [
906
- import_zod2.z.object({
907
- type: import_zod2.z.literal("text"),
908
- 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()
909
923
  }),
910
- import_zod2.z.object({
911
- type: import_zod2.z.literal("thinking"),
912
- thinking: import_zod2.z.string(),
913
- 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()
914
928
  }),
915
- import_zod2.z.object({
916
- type: import_zod2.z.literal("redacted_thinking"),
917
- data: import_zod2.z.string()
929
+ import_zod3.z.object({
930
+ type: import_zod3.z.literal("redacted_thinking"),
931
+ data: import_zod3.z.string()
918
932
  }),
919
- import_zod2.z.object({
920
- type: import_zod2.z.literal("tool_use"),
921
- id: import_zod2.z.string(),
922
- name: import_zod2.z.string(),
923
- 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()
924
938
  })
925
939
  ])
926
940
  ),
927
- stop_reason: import_zod2.z.string().nullish(),
928
- usage: import_zod2.z.object({
929
- input_tokens: import_zod2.z.number(),
930
- output_tokens: import_zod2.z.number(),
931
- cache_creation_input_tokens: import_zod2.z.number().nullish(),
932
- 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()
933
947
  })
934
948
  });
935
- var anthropicMessagesChunkSchema = import_zod2.z.discriminatedUnion("type", [
936
- import_zod2.z.object({
937
- type: import_zod2.z.literal("message_start"),
938
- message: import_zod2.z.object({
939
- id: import_zod2.z.string().nullish(),
940
- model: import_zod2.z.string().nullish(),
941
- usage: import_zod2.z.object({
942
- input_tokens: import_zod2.z.number(),
943
- output_tokens: import_zod2.z.number(),
944
- cache_creation_input_tokens: import_zod2.z.number().nullish(),
945
- 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()
946
960
  })
947
961
  })
948
962
  }),
949
- import_zod2.z.object({
950
- type: import_zod2.z.literal("content_block_start"),
951
- index: import_zod2.z.number(),
952
- content_block: import_zod2.z.discriminatedUnion("type", [
953
- import_zod2.z.object({
954
- type: import_zod2.z.literal("text"),
955
- 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()
956
970
  }),
957
- import_zod2.z.object({
958
- type: import_zod2.z.literal("thinking"),
959
- thinking: import_zod2.z.string()
971
+ import_zod3.z.object({
972
+ type: import_zod3.z.literal("thinking"),
973
+ thinking: import_zod3.z.string()
960
974
  }),
961
- import_zod2.z.object({
962
- type: import_zod2.z.literal("tool_use"),
963
- id: import_zod2.z.string(),
964
- 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()
965
979
  }),
966
- import_zod2.z.object({
967
- type: import_zod2.z.literal("redacted_thinking"),
968
- data: import_zod2.z.string()
980
+ import_zod3.z.object({
981
+ type: import_zod3.z.literal("redacted_thinking"),
982
+ data: import_zod3.z.string()
969
983
  })
970
984
  ])
971
985
  }),
972
- import_zod2.z.object({
973
- type: import_zod2.z.literal("content_block_delta"),
974
- index: import_zod2.z.number(),
975
- delta: import_zod2.z.discriminatedUnion("type", [
976
- import_zod2.z.object({
977
- type: import_zod2.z.literal("input_json_delta"),
978
- 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()
979
993
  }),
980
- import_zod2.z.object({
981
- type: import_zod2.z.literal("text_delta"),
982
- text: import_zod2.z.string()
994
+ import_zod3.z.object({
995
+ type: import_zod3.z.literal("text_delta"),
996
+ text: import_zod3.z.string()
983
997
  }),
984
- import_zod2.z.object({
985
- type: import_zod2.z.literal("thinking_delta"),
986
- thinking: import_zod2.z.string()
998
+ import_zod3.z.object({
999
+ type: import_zod3.z.literal("thinking_delta"),
1000
+ thinking: import_zod3.z.string()
987
1001
  }),
988
- import_zod2.z.object({
989
- type: import_zod2.z.literal("signature_delta"),
990
- signature: import_zod2.z.string()
1002
+ import_zod3.z.object({
1003
+ type: import_zod3.z.literal("signature_delta"),
1004
+ signature: import_zod3.z.string()
991
1005
  })
992
1006
  ])
993
1007
  }),
994
- import_zod2.z.object({
995
- type: import_zod2.z.literal("content_block_stop"),
996
- 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()
997
1011
  }),
998
- import_zod2.z.object({
999
- type: import_zod2.z.literal("error"),
1000
- error: import_zod2.z.object({
1001
- type: import_zod2.z.string(),
1002
- 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()
1003
1017
  })
1004
1018
  }),
1005
- import_zod2.z.object({
1006
- type: import_zod2.z.literal("message_delta"),
1007
- delta: import_zod2.z.object({ stop_reason: import_zod2.z.string().nullish() }),
1008
- 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() })
1009
1023
  }),
1010
- import_zod2.z.object({
1011
- type: import_zod2.z.literal("message_stop")
1024
+ import_zod3.z.object({
1025
+ type: import_zod3.z.literal("message_stop")
1012
1026
  }),
1013
- import_zod2.z.object({
1014
- type: import_zod2.z.literal("ping")
1027
+ import_zod3.z.object({
1028
+ type: import_zod3.z.literal("ping")
1015
1029
  })
1016
1030
  ]);
1017
- var anthropicProviderOptionsSchema = import_zod2.z.object({
1018
- thinking: import_zod2.z.object({
1019
- type: import_zod2.z.union([import_zod2.z.literal("enabled"), import_zod2.z.literal("disabled")]),
1020
- budgetTokens: import_zod2.z.number().optional()
1021
- }).optional()
1022
- });
1023
- var anthropicReasoningMetadataSchema = import_zod2.z.object({
1024
- signature: import_zod2.z.string().optional(),
1025
- redactedData: import_zod2.z.string().optional()
1031
+ var anthropicReasoningMetadataSchema = import_zod3.z.object({
1032
+ signature: import_zod3.z.string().optional(),
1033
+ redactedData: import_zod3.z.string().optional()
1026
1034
  });
1027
1035
 
1028
1036
  // src/anthropic-tools.ts
1029
- var import_zod3 = require("zod");
1030
- var Bash20241022Parameters = import_zod3.z.object({
1031
- command: import_zod3.z.string(),
1032
- 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()
1033
1041
  });
1034
1042
  function bashTool_20241022(options = {}) {
1035
1043
  return {
@@ -1041,9 +1049,9 @@ function bashTool_20241022(options = {}) {
1041
1049
  experimental_toToolResultContent: options.experimental_toToolResultContent
1042
1050
  };
1043
1051
  }
1044
- var Bash20250124Parameters = import_zod3.z.object({
1045
- command: import_zod3.z.string(),
1046
- 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()
1047
1055
  });
1048
1056
  function bashTool_20250124(options = {}) {
1049
1057
  return {
@@ -1055,14 +1063,14 @@ function bashTool_20250124(options = {}) {
1055
1063
  experimental_toToolResultContent: options.experimental_toToolResultContent
1056
1064
  };
1057
1065
  }
1058
- var TextEditor20241022Parameters = import_zod3.z.object({
1059
- command: import_zod3.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1060
- path: import_zod3.z.string(),
1061
- file_text: import_zod3.z.string().optional(),
1062
- insert_line: import_zod3.z.number().int().optional(),
1063
- new_str: import_zod3.z.string().optional(),
1064
- old_str: import_zod3.z.string().optional(),
1065
- 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()
1066
1074
  });
1067
1075
  function textEditorTool_20241022(options = {}) {
1068
1076
  return {
@@ -1074,14 +1082,14 @@ function textEditorTool_20241022(options = {}) {
1074
1082
  experimental_toToolResultContent: options.experimental_toToolResultContent
1075
1083
  };
1076
1084
  }
1077
- var TextEditor20250124Parameters = import_zod3.z.object({
1078
- command: import_zod3.z.enum(["view", "create", "str_replace", "insert", "undo_edit"]),
1079
- path: import_zod3.z.string(),
1080
- file_text: import_zod3.z.string().optional(),
1081
- insert_line: import_zod3.z.number().int().optional(),
1082
- new_str: import_zod3.z.string().optional(),
1083
- old_str: import_zod3.z.string().optional(),
1084
- 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()
1085
1093
  });
1086
1094
  function textEditorTool_20250124(options = {}) {
1087
1095
  return {
@@ -1093,8 +1101,8 @@ function textEditorTool_20250124(options = {}) {
1093
1101
  experimental_toToolResultContent: options.experimental_toToolResultContent
1094
1102
  };
1095
1103
  }
1096
- var Computer20241022Parameters = import_zod3.z.object({
1097
- action: import_zod3.z.enum([
1104
+ var Computer20241022Parameters = import_zod4.z.object({
1105
+ action: import_zod4.z.enum([
1098
1106
  "key",
1099
1107
  "type",
1100
1108
  "mouse_move",
@@ -1106,8 +1114,8 @@ var Computer20241022Parameters = import_zod3.z.object({
1106
1114
  "screenshot",
1107
1115
  "cursor_position"
1108
1116
  ]),
1109
- coordinate: import_zod3.z.array(import_zod3.z.number().int()).optional(),
1110
- 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()
1111
1119
  });
1112
1120
  function computerTool_20241022(options) {
1113
1121
  return {
@@ -1123,8 +1131,8 @@ function computerTool_20241022(options) {
1123
1131
  experimental_toToolResultContent: options.experimental_toToolResultContent
1124
1132
  };
1125
1133
  }
1126
- var Computer20250124Parameters = import_zod3.z.object({
1127
- action: import_zod3.z.enum([
1134
+ var Computer20250124Parameters = import_zod4.z.object({
1135
+ action: import_zod4.z.enum([
1128
1136
  "key",
1129
1137
  "hold_key",
1130
1138
  "type",
@@ -1142,12 +1150,12 @@ var Computer20250124Parameters = import_zod3.z.object({
1142
1150
  "wait",
1143
1151
  "screenshot"
1144
1152
  ]),
1145
- coordinate: import_zod3.z.tuple([import_zod3.z.number().int(), import_zod3.z.number().int()]).optional(),
1146
- duration: import_zod3.z.number().optional(),
1147
- scroll_amount: import_zod3.z.number().optional(),
1148
- scroll_direction: import_zod3.z.enum(["up", "down", "left", "right"]).optional(),
1149
- start_coordinate: import_zod3.z.tuple([import_zod3.z.number().int(), import_zod3.z.number().int()]).optional(),
1150
- 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()
1151
1159
  });
1152
1160
  function computerTool_20250124(options) {
1153
1161
  return {
@@ -1185,7 +1193,7 @@ function createAnthropic(options = {}) {
1185
1193
  }),
1186
1194
  ...options.headers
1187
1195
  });
1188
- const createChatModel = (modelId, settings = {}) => new AnthropicMessagesLanguageModel(modelId, settings, {
1196
+ const createChatModel = (modelId) => new AnthropicMessagesLanguageModel(modelId, {
1189
1197
  provider: "anthropic.messages",
1190
1198
  baseURL,
1191
1199
  headers: getHeaders,
@@ -1194,13 +1202,13 @@ function createAnthropic(options = {}) {
1194
1202
  "image/*": [/^https?:\/\/.*$/]
1195
1203
  })
1196
1204
  });
1197
- const provider = function(modelId, settings) {
1205
+ const provider = function(modelId) {
1198
1206
  if (new.target) {
1199
1207
  throw new Error(
1200
1208
  "The Anthropic model function cannot be called with the new keyword."
1201
1209
  );
1202
1210
  }
1203
- return createChatModel(modelId, settings);
1211
+ return createChatModel(modelId);
1204
1212
  };
1205
1213
  provider.languageModel = createChatModel;
1206
1214
  provider.chat = createChatModel;