@ai-sdk/anthropic 2.0.0-alpha.7 → 2.0.0-alpha.9
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 +20 -0
- package/dist/index.d.mts +89 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +307 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +310 -57
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +2 -0
- package/dist/internal/index.d.ts +2 -0
- package/dist/internal/index.js +294 -48
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +296 -48
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @ai-sdk/anthropic
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 362b048: add web search tool support
|
|
8
|
+
- Updated dependencies [811dff3]
|
|
9
|
+
- @ai-sdk/provider@2.0.0-alpha.9
|
|
10
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.9
|
|
11
|
+
|
|
12
|
+
## 2.0.0-alpha.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- ad66c0e: feat (provider/anthropic): json response schema support via tool calls
|
|
17
|
+
- 075711d: fix (provider/anthropic): return stop finish reason for json output with tool
|
|
18
|
+
- Updated dependencies [4fef487]
|
|
19
|
+
- Updated dependencies [9222aeb]
|
|
20
|
+
- @ai-sdk/provider-utils@3.0.0-alpha.8
|
|
21
|
+
- @ai-sdk/provider@2.0.0-alpha.8
|
|
22
|
+
|
|
3
23
|
## 2.0.0-alpha.7
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -20,18 +20,107 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
20
20
|
type: "enabled" | "disabled";
|
|
21
21
|
budgetTokens?: number | undefined;
|
|
22
22
|
}>>;
|
|
23
|
+
/**
|
|
24
|
+
* Web search tool configuration for Claude models that support it.
|
|
25
|
+
* When provided, automatically adds the web search tool to the request.
|
|
26
|
+
*/
|
|
27
|
+
webSearch: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
/**
|
|
29
|
+
* Limit the number of searches per request (optional)
|
|
30
|
+
* Defaults to 5 if not specified
|
|
31
|
+
*/
|
|
32
|
+
maxUses: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
/**
|
|
34
|
+
* Only include results from these domains (optional)
|
|
35
|
+
* Cannot be used with blockedDomains
|
|
36
|
+
*/
|
|
37
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
38
|
+
/**
|
|
39
|
+
* Never include results from these domains (optional)
|
|
40
|
+
* Cannot be used with allowedDomains
|
|
41
|
+
*/
|
|
42
|
+
blockedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
/**
|
|
44
|
+
* Localize search results based on user location (optional)
|
|
45
|
+
*/
|
|
46
|
+
userLocation: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"approximate">;
|
|
48
|
+
city: z.ZodOptional<z.ZodString>;
|
|
49
|
+
region: z.ZodOptional<z.ZodString>;
|
|
50
|
+
country: z.ZodString;
|
|
51
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "approximate";
|
|
54
|
+
country: string;
|
|
55
|
+
city?: string | undefined;
|
|
56
|
+
region?: string | undefined;
|
|
57
|
+
timezone?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
type: "approximate";
|
|
60
|
+
country: string;
|
|
61
|
+
city?: string | undefined;
|
|
62
|
+
region?: string | undefined;
|
|
63
|
+
timezone?: string | undefined;
|
|
64
|
+
}>>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
maxUses?: number | undefined;
|
|
67
|
+
allowedDomains?: string[] | undefined;
|
|
68
|
+
blockedDomains?: string[] | undefined;
|
|
69
|
+
userLocation?: {
|
|
70
|
+
type: "approximate";
|
|
71
|
+
country: string;
|
|
72
|
+
city?: string | undefined;
|
|
73
|
+
region?: string | undefined;
|
|
74
|
+
timezone?: string | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
maxUses?: number | undefined;
|
|
78
|
+
allowedDomains?: string[] | undefined;
|
|
79
|
+
blockedDomains?: string[] | undefined;
|
|
80
|
+
userLocation?: {
|
|
81
|
+
type: "approximate";
|
|
82
|
+
country: string;
|
|
83
|
+
city?: string | undefined;
|
|
84
|
+
region?: string | undefined;
|
|
85
|
+
timezone?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
}>>;
|
|
23
88
|
}, "strip", z.ZodTypeAny, {
|
|
24
89
|
sendReasoning?: boolean | undefined;
|
|
25
90
|
thinking?: {
|
|
26
91
|
type: "enabled" | "disabled";
|
|
27
92
|
budgetTokens?: number | undefined;
|
|
28
93
|
} | undefined;
|
|
94
|
+
webSearch?: {
|
|
95
|
+
maxUses?: number | undefined;
|
|
96
|
+
allowedDomains?: string[] | undefined;
|
|
97
|
+
blockedDomains?: string[] | undefined;
|
|
98
|
+
userLocation?: {
|
|
99
|
+
type: "approximate";
|
|
100
|
+
country: string;
|
|
101
|
+
city?: string | undefined;
|
|
102
|
+
region?: string | undefined;
|
|
103
|
+
timezone?: string | undefined;
|
|
104
|
+
} | undefined;
|
|
105
|
+
} | undefined;
|
|
29
106
|
}, {
|
|
30
107
|
sendReasoning?: boolean | undefined;
|
|
31
108
|
thinking?: {
|
|
32
109
|
type: "enabled" | "disabled";
|
|
33
110
|
budgetTokens?: number | undefined;
|
|
34
111
|
} | undefined;
|
|
112
|
+
webSearch?: {
|
|
113
|
+
maxUses?: number | undefined;
|
|
114
|
+
allowedDomains?: string[] | undefined;
|
|
115
|
+
blockedDomains?: string[] | undefined;
|
|
116
|
+
userLocation?: {
|
|
117
|
+
type: "approximate";
|
|
118
|
+
country: string;
|
|
119
|
+
city?: string | undefined;
|
|
120
|
+
region?: string | undefined;
|
|
121
|
+
timezone?: string | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
} | undefined;
|
|
35
124
|
}>;
|
|
36
125
|
type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
37
126
|
|
package/dist/index.d.ts
CHANGED
|
@@ -20,18 +20,107 @@ declare const anthropicProviderOptions: z.ZodObject<{
|
|
|
20
20
|
type: "enabled" | "disabled";
|
|
21
21
|
budgetTokens?: number | undefined;
|
|
22
22
|
}>>;
|
|
23
|
+
/**
|
|
24
|
+
* Web search tool configuration for Claude models that support it.
|
|
25
|
+
* When provided, automatically adds the web search tool to the request.
|
|
26
|
+
*/
|
|
27
|
+
webSearch: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
/**
|
|
29
|
+
* Limit the number of searches per request (optional)
|
|
30
|
+
* Defaults to 5 if not specified
|
|
31
|
+
*/
|
|
32
|
+
maxUses: z.ZodOptional<z.ZodNumber>;
|
|
33
|
+
/**
|
|
34
|
+
* Only include results from these domains (optional)
|
|
35
|
+
* Cannot be used with blockedDomains
|
|
36
|
+
*/
|
|
37
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
38
|
+
/**
|
|
39
|
+
* Never include results from these domains (optional)
|
|
40
|
+
* Cannot be used with allowedDomains
|
|
41
|
+
*/
|
|
42
|
+
blockedDomains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
/**
|
|
44
|
+
* Localize search results based on user location (optional)
|
|
45
|
+
*/
|
|
46
|
+
userLocation: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
type: z.ZodLiteral<"approximate">;
|
|
48
|
+
city: z.ZodOptional<z.ZodString>;
|
|
49
|
+
region: z.ZodOptional<z.ZodString>;
|
|
50
|
+
country: z.ZodString;
|
|
51
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "approximate";
|
|
54
|
+
country: string;
|
|
55
|
+
city?: string | undefined;
|
|
56
|
+
region?: string | undefined;
|
|
57
|
+
timezone?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
type: "approximate";
|
|
60
|
+
country: string;
|
|
61
|
+
city?: string | undefined;
|
|
62
|
+
region?: string | undefined;
|
|
63
|
+
timezone?: string | undefined;
|
|
64
|
+
}>>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
maxUses?: number | undefined;
|
|
67
|
+
allowedDomains?: string[] | undefined;
|
|
68
|
+
blockedDomains?: string[] | undefined;
|
|
69
|
+
userLocation?: {
|
|
70
|
+
type: "approximate";
|
|
71
|
+
country: string;
|
|
72
|
+
city?: string | undefined;
|
|
73
|
+
region?: string | undefined;
|
|
74
|
+
timezone?: string | undefined;
|
|
75
|
+
} | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
maxUses?: number | undefined;
|
|
78
|
+
allowedDomains?: string[] | undefined;
|
|
79
|
+
blockedDomains?: string[] | undefined;
|
|
80
|
+
userLocation?: {
|
|
81
|
+
type: "approximate";
|
|
82
|
+
country: string;
|
|
83
|
+
city?: string | undefined;
|
|
84
|
+
region?: string | undefined;
|
|
85
|
+
timezone?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
}>>;
|
|
23
88
|
}, "strip", z.ZodTypeAny, {
|
|
24
89
|
sendReasoning?: boolean | undefined;
|
|
25
90
|
thinking?: {
|
|
26
91
|
type: "enabled" | "disabled";
|
|
27
92
|
budgetTokens?: number | undefined;
|
|
28
93
|
} | undefined;
|
|
94
|
+
webSearch?: {
|
|
95
|
+
maxUses?: number | undefined;
|
|
96
|
+
allowedDomains?: string[] | undefined;
|
|
97
|
+
blockedDomains?: string[] | undefined;
|
|
98
|
+
userLocation?: {
|
|
99
|
+
type: "approximate";
|
|
100
|
+
country: string;
|
|
101
|
+
city?: string | undefined;
|
|
102
|
+
region?: string | undefined;
|
|
103
|
+
timezone?: string | undefined;
|
|
104
|
+
} | undefined;
|
|
105
|
+
} | undefined;
|
|
29
106
|
}, {
|
|
30
107
|
sendReasoning?: boolean | undefined;
|
|
31
108
|
thinking?: {
|
|
32
109
|
type: "enabled" | "disabled";
|
|
33
110
|
budgetTokens?: number | undefined;
|
|
34
111
|
} | undefined;
|
|
112
|
+
webSearch?: {
|
|
113
|
+
maxUses?: number | undefined;
|
|
114
|
+
allowedDomains?: string[] | undefined;
|
|
115
|
+
blockedDomains?: string[] | undefined;
|
|
116
|
+
userLocation?: {
|
|
117
|
+
type: "approximate";
|
|
118
|
+
country: string;
|
|
119
|
+
city?: string | undefined;
|
|
120
|
+
region?: string | undefined;
|
|
121
|
+
timezone?: string | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
} | undefined;
|
|
35
124
|
}>;
|
|
36
125
|
type AnthropicProviderOptions = z.infer<typeof anthropicProviderOptions>;
|
|
37
126
|
|