@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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
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
+
14
+ ## 2.0.0-canary.11
15
+
16
+ ### Patch Changes
17
+
18
+ - 66962ed: fix(packages): export node10 compatible types
19
+ - Updated dependencies [66962ed]
20
+ - Updated dependencies [9301f86]
21
+ - Updated dependencies [a3f768e]
22
+ - @ai-sdk/provider-utils@3.0.0-canary.11
23
+ - @ai-sdk/provider@2.0.0-canary.10
24
+
3
25
  ## 2.0.0-canary.10
4
26
 
5
27
  ### 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
  */