@effect/ai-anthropic 0.9.2 → 0.9.4
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/cjs/Generated.js +1324 -449
- package/dist/cjs/Generated.js.map +1 -1
- package/dist/dts/Generated.d.ts +2224 -535
- package/dist/dts/Generated.d.ts.map +1 -1
- package/dist/esm/Generated.js +1112 -370
- package/dist/esm/Generated.js.map +1 -1
- package/package.json +4 -4
- package/src/Generated.ts +1350 -477
package/dist/esm/Generated.js
CHANGED
|
@@ -8,168 +8,216 @@ export class MessagesPostParams extends /*#__PURE__*/S.Struct({
|
|
|
8
8
|
nullable: true
|
|
9
9
|
})
|
|
10
10
|
}) {}
|
|
11
|
-
export class Model extends /*#__PURE__*/S.Union(/*#__PURE__*/S.Literal("claude-3-7-sonnet-latest"), /*#__PURE__*/S.Literal("claude-3-7-sonnet-20250219"), /*#__PURE__*/S.Literal("claude-3-5-haiku-latest"), /*#__PURE__*/S.Literal("claude-3-5-haiku-20241022"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-latest"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-20241022"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-20240620"), /*#__PURE__*/S.Literal("claude-3-opus-latest"), /*#__PURE__*/S.Literal("claude-3-opus-20240229"), /*#__PURE__*/S.Literal("claude-3-sonnet-20240229"), /*#__PURE__*/S.Literal("claude-3-haiku-20240307"), /*#__PURE__*/S.Literal("claude-2.1"), /*#__PURE__*/S.Literal("claude-2.0")) {}
|
|
12
|
-
export class InputMessageRole extends /*#__PURE__*/S.Literal("user", "assistant") {}
|
|
11
|
+
export class Model extends /*#__PURE__*/S.Union(/*#__PURE__*/S.Literal("claude-3-7-sonnet-latest"), /*#__PURE__*/S.Literal("claude-3-7-sonnet-20250219"), /*#__PURE__*/S.Literal("claude-3-5-haiku-latest"), /*#__PURE__*/S.Literal("claude-3-5-haiku-20241022"), /*#__PURE__*/S.Literal("claude-sonnet-4-20250514"), /*#__PURE__*/S.Literal("claude-sonnet-4-0"), /*#__PURE__*/S.Literal("claude-4-sonnet-20250514"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-latest"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-20241022"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-20240620"), /*#__PURE__*/S.Literal("claude-opus-4-0"), /*#__PURE__*/S.Literal("claude-opus-4-20250514"), /*#__PURE__*/S.Literal("claude-4-opus-20250514"), /*#__PURE__*/S.Literal("claude-3-opus-latest"), /*#__PURE__*/S.Literal("claude-3-opus-20240229"), /*#__PURE__*/S.Literal("claude-3-sonnet-20240229"), /*#__PURE__*/S.Literal("claude-3-haiku-20240307"), /*#__PURE__*/S.Literal("claude-2.1"), /*#__PURE__*/S.Literal("claude-2.0")) {}
|
|
13
12
|
export class CacheControlEphemeralType extends /*#__PURE__*/S.Literal("ephemeral") {}
|
|
14
13
|
export class CacheControlEphemeral extends /*#__PURE__*/S.Struct({
|
|
15
14
|
"type": CacheControlEphemeralType
|
|
16
15
|
}) {}
|
|
16
|
+
export class RequestServerToolUseBlockName extends /*#__PURE__*/S.Literal("web_search") {}
|
|
17
|
+
export class RequestServerToolUseBlockType extends /*#__PURE__*/S.Literal("server_tool_use") {}
|
|
18
|
+
export class RequestServerToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
19
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
20
|
+
nullable: true
|
|
21
|
+
}),
|
|
22
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
23
|
+
"input": /*#__PURE__*/S.Record({
|
|
24
|
+
key: S.String,
|
|
25
|
+
value: S.Unknown
|
|
26
|
+
}),
|
|
27
|
+
"name": RequestServerToolUseBlockName,
|
|
28
|
+
"type": RequestServerToolUseBlockType
|
|
29
|
+
}) {}
|
|
30
|
+
export class RequestWebSearchResultBlockType extends /*#__PURE__*/S.Literal("web_search_result") {}
|
|
31
|
+
export class RequestWebSearchResultBlock extends /*#__PURE__*/S.Struct({
|
|
32
|
+
"encrypted_content": S.String,
|
|
33
|
+
"page_age": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
34
|
+
nullable: true
|
|
35
|
+
}),
|
|
36
|
+
"title": S.String,
|
|
37
|
+
"type": RequestWebSearchResultBlockType,
|
|
38
|
+
"url": S.String
|
|
39
|
+
}) {}
|
|
40
|
+
export class WebSearchToolResultErrorCode extends /*#__PURE__*/S.Literal("invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long") {}
|
|
41
|
+
export class RequestWebSearchToolResultErrorType extends /*#__PURE__*/S.Literal("web_search_tool_result_error") {}
|
|
42
|
+
export class RequestWebSearchToolResultError extends /*#__PURE__*/S.Struct({
|
|
43
|
+
"error_code": WebSearchToolResultErrorCode,
|
|
44
|
+
"type": RequestWebSearchToolResultErrorType
|
|
45
|
+
}) {}
|
|
46
|
+
export class RequestWebSearchToolResultBlockType extends /*#__PURE__*/S.Literal("web_search_tool_result") {}
|
|
47
|
+
export class RequestWebSearchToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
48
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
49
|
+
nullable: true
|
|
50
|
+
}),
|
|
51
|
+
"content": /*#__PURE__*/S.Union(/*#__PURE__*/S.Array(RequestWebSearchResultBlock), RequestWebSearchToolResultError),
|
|
52
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
53
|
+
"type": RequestWebSearchToolResultBlockType
|
|
54
|
+
}) {}
|
|
17
55
|
export class RequestCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
|
|
18
56
|
export class RequestCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
19
|
-
"type": RequestCharLocationCitationType,
|
|
20
57
|
"cited_text": S.String,
|
|
21
58
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
22
59
|
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
60
|
+
"end_char_index": S.Int,
|
|
23
61
|
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
24
|
-
"
|
|
62
|
+
"type": RequestCharLocationCitationType
|
|
25
63
|
}) {}
|
|
26
64
|
export class RequestPageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
|
|
27
65
|
export class RequestPageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
28
|
-
"type": RequestPageLocationCitationType,
|
|
29
66
|
"cited_text": S.String,
|
|
30
67
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
31
68
|
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
69
|
+
"end_page_number": S.Int,
|
|
32
70
|
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
33
|
-
"
|
|
71
|
+
"type": RequestPageLocationCitationType
|
|
34
72
|
}) {}
|
|
35
73
|
export class RequestContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
|
|
36
74
|
export class RequestContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
37
|
-
"type": RequestContentBlockLocationCitationType,
|
|
38
75
|
"cited_text": S.String,
|
|
39
76
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
40
77
|
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
78
|
+
"end_block_index": S.Int,
|
|
41
79
|
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
42
|
-
"
|
|
80
|
+
"type": RequestContentBlockLocationCitationType
|
|
81
|
+
}) {}
|
|
82
|
+
export class RequestWebSearchResultLocationCitationType extends /*#__PURE__*/S.Literal("web_search_result_location") {}
|
|
83
|
+
export class RequestWebSearchResultLocationCitation extends /*#__PURE__*/S.Struct({
|
|
84
|
+
"cited_text": S.String,
|
|
85
|
+
"encrypted_index": S.String,
|
|
86
|
+
"title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
87
|
+
"type": RequestWebSearchResultLocationCitationType,
|
|
88
|
+
"url": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(2048))
|
|
43
89
|
}) {}
|
|
44
90
|
export class RequestTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
45
91
|
export class RequestTextBlock extends /*#__PURE__*/S.Struct({
|
|
46
92
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
47
93
|
nullable: true
|
|
48
94
|
}),
|
|
49
|
-
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(RequestCharLocationCitation, RequestPageLocationCitation, RequestContentBlockLocationCitation)), S.Null), {
|
|
95
|
+
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(RequestCharLocationCitation, RequestPageLocationCitation, RequestContentBlockLocationCitation, RequestWebSearchResultLocationCitation)), S.Null), {
|
|
50
96
|
nullable: true
|
|
51
97
|
}),
|
|
52
98
|
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
53
99
|
"type": RequestTextBlockType
|
|
54
100
|
}) {}
|
|
55
|
-
export class RequestImageBlockType extends /*#__PURE__*/S.Literal("image") {}
|
|
56
|
-
export class Base64ImageSourceType extends /*#__PURE__*/S.Literal("base64") {}
|
|
57
101
|
export class Base64ImageSourceMediaType extends /*#__PURE__*/S.Literal("image/jpeg", "image/png", "image/gif", "image/webp") {}
|
|
102
|
+
export class Base64ImageSourceType extends /*#__PURE__*/S.Literal("base64") {}
|
|
58
103
|
export class Base64ImageSource extends /*#__PURE__*/S.Struct({
|
|
59
|
-
"
|
|
104
|
+
"data": S.String,
|
|
60
105
|
"media_type": Base64ImageSourceMediaType,
|
|
61
|
-
"
|
|
106
|
+
"type": Base64ImageSourceType
|
|
62
107
|
}) {}
|
|
63
108
|
export class URLImageSourceType extends /*#__PURE__*/S.Literal("url") {}
|
|
64
109
|
export class URLImageSource extends /*#__PURE__*/S.Struct({
|
|
65
110
|
"type": URLImageSourceType,
|
|
66
111
|
"url": S.String
|
|
67
112
|
}) {}
|
|
113
|
+
export class RequestImageBlockType extends /*#__PURE__*/S.Literal("image") {}
|
|
68
114
|
export class RequestImageBlock extends /*#__PURE__*/S.Struct({
|
|
69
115
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
70
116
|
nullable: true
|
|
71
117
|
}),
|
|
72
|
-
"
|
|
73
|
-
"
|
|
118
|
+
"source": /*#__PURE__*/S.Union(Base64ImageSource, URLImageSource),
|
|
119
|
+
"type": RequestImageBlockType
|
|
74
120
|
}) {}
|
|
75
121
|
export class RequestToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
76
122
|
export class RequestToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
77
123
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
78
124
|
nullable: true
|
|
79
125
|
}),
|
|
80
|
-
"type": RequestToolUseBlockType,
|
|
81
126
|
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
82
|
-
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(64), /*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]{1,64}$"))),
|
|
83
127
|
"input": /*#__PURE__*/S.Record({
|
|
84
128
|
key: S.String,
|
|
85
129
|
value: S.Unknown
|
|
86
|
-
})
|
|
130
|
+
}),
|
|
131
|
+
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(200)),
|
|
132
|
+
"type": RequestToolUseBlockType
|
|
87
133
|
}) {}
|
|
88
134
|
export class RequestToolResultBlockType extends /*#__PURE__*/S.Literal("tool_result") {}
|
|
89
135
|
export class RequestToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
90
136
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
91
137
|
nullable: true
|
|
92
138
|
}),
|
|
93
|
-
"
|
|
94
|
-
|
|
139
|
+
"content": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock))), {
|
|
140
|
+
nullable: true
|
|
141
|
+
}),
|
|
95
142
|
"is_error": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
96
143
|
nullable: true
|
|
97
144
|
}),
|
|
98
|
-
"
|
|
145
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
146
|
+
"type": RequestToolResultBlockType
|
|
147
|
+
}) {}
|
|
148
|
+
export class RequestCitationsConfig extends /*#__PURE__*/S.Struct({
|
|
149
|
+
"enabled": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
99
150
|
nullable: true
|
|
100
151
|
})
|
|
101
152
|
}) {}
|
|
102
|
-
export class RequestDocumentBlockType extends /*#__PURE__*/S.Literal("document") {}
|
|
103
|
-
export class Base64PDFSourceType extends /*#__PURE__*/S.Literal("base64") {}
|
|
104
153
|
export class Base64PDFSourceMediaType extends /*#__PURE__*/S.Literal("application/pdf") {}
|
|
154
|
+
export class Base64PDFSourceType extends /*#__PURE__*/S.Literal("base64") {}
|
|
105
155
|
export class Base64PDFSource extends /*#__PURE__*/S.Struct({
|
|
106
|
-
"
|
|
156
|
+
"data": S.String,
|
|
107
157
|
"media_type": Base64PDFSourceMediaType,
|
|
108
|
-
"
|
|
158
|
+
"type": Base64PDFSourceType
|
|
109
159
|
}) {}
|
|
110
|
-
export class PlainTextSourceType extends /*#__PURE__*/S.Literal("text") {}
|
|
111
160
|
export class PlainTextSourceMediaType extends /*#__PURE__*/S.Literal("text/plain") {}
|
|
161
|
+
export class PlainTextSourceType extends /*#__PURE__*/S.Literal("text") {}
|
|
112
162
|
export class PlainTextSource extends /*#__PURE__*/S.Struct({
|
|
113
|
-
"
|
|
163
|
+
"data": S.String,
|
|
114
164
|
"media_type": PlainTextSourceMediaType,
|
|
115
|
-
"
|
|
165
|
+
"type": PlainTextSourceType
|
|
116
166
|
}) {}
|
|
117
167
|
export class ContentBlockSourceType extends /*#__PURE__*/S.Literal("content") {}
|
|
118
168
|
export class ContentBlockSource extends /*#__PURE__*/S.Struct({
|
|
119
|
-
"
|
|
120
|
-
"
|
|
169
|
+
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock))),
|
|
170
|
+
"type": ContentBlockSourceType
|
|
121
171
|
}) {}
|
|
122
172
|
export class URLPDFSourceType extends /*#__PURE__*/S.Literal("url") {}
|
|
123
173
|
export class URLPDFSource extends /*#__PURE__*/S.Struct({
|
|
124
174
|
"type": URLPDFSourceType,
|
|
125
175
|
"url": S.String
|
|
126
176
|
}) {}
|
|
127
|
-
export class
|
|
128
|
-
"enabled": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
129
|
-
nullable: true
|
|
130
|
-
})
|
|
131
|
-
}) {}
|
|
177
|
+
export class RequestDocumentBlockType extends /*#__PURE__*/S.Literal("document") {}
|
|
132
178
|
export class RequestDocumentBlock extends /*#__PURE__*/S.Struct({
|
|
133
179
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
134
180
|
nullable: true
|
|
135
181
|
}),
|
|
136
|
-
"
|
|
137
|
-
"source": /*#__PURE__*/S.Union(Base64PDFSource, PlainTextSource, ContentBlockSource, URLPDFSource),
|
|
138
|
-
"title": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)), S.Null), {
|
|
182
|
+
"citations": /*#__PURE__*/S.optionalWith(RequestCitationsConfig, {
|
|
139
183
|
nullable: true
|
|
140
184
|
}),
|
|
141
185
|
"context": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)), S.Null), {
|
|
142
186
|
nullable: true
|
|
143
187
|
}),
|
|
144
|
-
"
|
|
188
|
+
"source": /*#__PURE__*/S.Union(Base64PDFSource, PlainTextSource, ContentBlockSource, URLPDFSource),
|
|
189
|
+
"title": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)), S.Null), {
|
|
145
190
|
nullable: true
|
|
146
|
-
})
|
|
191
|
+
}),
|
|
192
|
+
"type": RequestDocumentBlockType
|
|
147
193
|
}) {}
|
|
148
194
|
export class RequestThinkingBlockType extends /*#__PURE__*/S.Literal("thinking") {}
|
|
149
195
|
export class RequestThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
150
|
-
"
|
|
196
|
+
"signature": S.String,
|
|
151
197
|
"thinking": S.String,
|
|
152
|
-
"
|
|
198
|
+
"type": RequestThinkingBlockType
|
|
153
199
|
}) {}
|
|
154
200
|
export class RequestRedactedThinkingBlockType extends /*#__PURE__*/S.Literal("redacted_thinking") {}
|
|
155
201
|
export class RequestRedactedThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
156
|
-
"
|
|
157
|
-
"
|
|
202
|
+
"data": S.String,
|
|
203
|
+
"type": RequestRedactedThinkingBlockType
|
|
158
204
|
}) {}
|
|
159
|
-
export class InputContentBlock extends /*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock, RequestToolUseBlock, RequestToolResultBlock, RequestDocumentBlock, RequestThinkingBlock, RequestRedactedThinkingBlock) {}
|
|
205
|
+
export class InputContentBlock extends /*#__PURE__*/S.Union(RequestServerToolUseBlock, RequestWebSearchToolResultBlock, RequestTextBlock, RequestImageBlock, RequestToolUseBlock, RequestToolResultBlock, RequestDocumentBlock, RequestThinkingBlock, RequestRedactedThinkingBlock) {}
|
|
206
|
+
export class InputMessageRole extends /*#__PURE__*/S.Literal("user", "assistant") {}
|
|
160
207
|
export class InputMessage extends /*#__PURE__*/S.Struct({
|
|
161
|
-
"
|
|
162
|
-
"
|
|
208
|
+
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(InputContentBlock)),
|
|
209
|
+
"role": InputMessageRole
|
|
163
210
|
}) {}
|
|
164
211
|
export class Metadata extends /*#__PURE__*/S.Struct({
|
|
165
212
|
"user_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.maxLength(256)), S.Null), {
|
|
166
213
|
nullable: true
|
|
167
214
|
})
|
|
168
215
|
}) {}
|
|
216
|
+
export class CreateMessageParamsServiceTier extends /*#__PURE__*/S.Literal("auto", "standard_only") {}
|
|
169
217
|
export class ThinkingConfigEnabledType extends /*#__PURE__*/S.Literal("enabled") {}
|
|
170
218
|
export class ThinkingConfigEnabled extends /*#__PURE__*/S.Struct({
|
|
171
|
-
"
|
|
172
|
-
"
|
|
219
|
+
"budget_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1024)),
|
|
220
|
+
"type": ThinkingConfigEnabledType
|
|
173
221
|
}) {}
|
|
174
222
|
export class ThinkingConfigDisabledType extends /*#__PURE__*/S.Literal("disabled") {}
|
|
175
223
|
export class ThinkingConfigDisabled extends /*#__PURE__*/S.Struct({
|
|
@@ -178,42 +226,49 @@ export class ThinkingConfigDisabled extends /*#__PURE__*/S.Struct({
|
|
|
178
226
|
export class ThinkingConfigParam extends /*#__PURE__*/S.Union(ThinkingConfigEnabled, ThinkingConfigDisabled) {}
|
|
179
227
|
export class ToolChoiceAutoType extends /*#__PURE__*/S.Literal("auto") {}
|
|
180
228
|
export class ToolChoiceAuto extends /*#__PURE__*/S.Struct({
|
|
181
|
-
"type": ToolChoiceAutoType,
|
|
182
229
|
"disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
183
230
|
nullable: true
|
|
184
|
-
})
|
|
231
|
+
}),
|
|
232
|
+
"type": ToolChoiceAutoType
|
|
185
233
|
}) {}
|
|
186
234
|
export class ToolChoiceAnyType extends /*#__PURE__*/S.Literal("any") {}
|
|
187
235
|
export class ToolChoiceAny extends /*#__PURE__*/S.Struct({
|
|
188
|
-
"type": ToolChoiceAnyType,
|
|
189
236
|
"disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
190
237
|
nullable: true
|
|
191
|
-
})
|
|
238
|
+
}),
|
|
239
|
+
"type": ToolChoiceAnyType
|
|
192
240
|
}) {}
|
|
193
241
|
export class ToolChoiceToolType extends /*#__PURE__*/S.Literal("tool") {}
|
|
194
242
|
export class ToolChoiceTool extends /*#__PURE__*/S.Struct({
|
|
195
|
-
"type": ToolChoiceToolType,
|
|
196
|
-
"name": S.String,
|
|
197
243
|
"disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
198
244
|
nullable: true
|
|
199
|
-
})
|
|
245
|
+
}),
|
|
246
|
+
"name": S.String,
|
|
247
|
+
"type": ToolChoiceToolType
|
|
200
248
|
}) {}
|
|
201
249
|
export class ToolChoiceNoneType extends /*#__PURE__*/S.Literal("none") {}
|
|
202
250
|
export class ToolChoiceNone extends /*#__PURE__*/S.Struct({
|
|
203
251
|
"type": ToolChoiceNoneType
|
|
204
252
|
}) {}
|
|
205
253
|
export class ToolChoice extends /*#__PURE__*/S.Union(ToolChoiceAuto, ToolChoiceAny, ToolChoiceTool, ToolChoiceNone) {}
|
|
254
|
+
export class ToolTypeEnum extends /*#__PURE__*/S.Literal("custom") {}
|
|
206
255
|
export class InputSchemaType extends /*#__PURE__*/S.Literal("object") {}
|
|
207
256
|
export class InputSchema extends /*#__PURE__*/S.Struct({
|
|
208
|
-
"type": InputSchemaType,
|
|
209
257
|
"properties": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Record({
|
|
210
258
|
key: S.String,
|
|
211
259
|
value: S.Unknown
|
|
212
260
|
}), S.Null), {
|
|
213
261
|
nullable: true
|
|
214
|
-
})
|
|
262
|
+
}),
|
|
263
|
+
"required": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(S.String), S.Null), {
|
|
264
|
+
nullable: true
|
|
265
|
+
}),
|
|
266
|
+
"type": InputSchemaType
|
|
215
267
|
}) {}
|
|
216
268
|
export class Tool extends /*#__PURE__*/S.Struct({
|
|
269
|
+
"type": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.Null, ToolTypeEnum), {
|
|
270
|
+
nullable: true
|
|
271
|
+
}),
|
|
217
272
|
"description": /*#__PURE__*/S.optionalWith(S.String, {
|
|
218
273
|
nullable: true
|
|
219
274
|
}),
|
|
@@ -223,31 +278,80 @@ export class Tool extends /*#__PURE__*/S.Struct({
|
|
|
223
278
|
nullable: true
|
|
224
279
|
})
|
|
225
280
|
}) {}
|
|
226
|
-
export class BashTool20250124Type extends /*#__PURE__*/S.Literal("bash_20250124") {}
|
|
227
281
|
export class BashTool20250124Name extends /*#__PURE__*/S.Literal("bash") {}
|
|
282
|
+
export class BashTool20250124Type extends /*#__PURE__*/S.Literal("bash_20250124") {}
|
|
228
283
|
export class BashTool20250124 extends /*#__PURE__*/S.Struct({
|
|
229
284
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
230
285
|
nullable: true
|
|
231
286
|
}),
|
|
232
|
-
"
|
|
233
|
-
"
|
|
287
|
+
"name": BashTool20250124Name,
|
|
288
|
+
"type": BashTool20250124Type
|
|
234
289
|
}) {}
|
|
235
|
-
export class TextEditor20250124Type extends /*#__PURE__*/S.Literal("text_editor_20250124") {}
|
|
236
290
|
export class TextEditor20250124Name extends /*#__PURE__*/S.Literal("str_replace_editor") {}
|
|
291
|
+
export class TextEditor20250124Type extends /*#__PURE__*/S.Literal("text_editor_20250124") {}
|
|
237
292
|
export class TextEditor20250124 extends /*#__PURE__*/S.Struct({
|
|
238
293
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
239
294
|
nullable: true
|
|
240
295
|
}),
|
|
241
|
-
"
|
|
242
|
-
"
|
|
296
|
+
"name": TextEditor20250124Name,
|
|
297
|
+
"type": TextEditor20250124Type
|
|
298
|
+
}) {}
|
|
299
|
+
export class TextEditor20250429Name extends /*#__PURE__*/S.Literal("str_replace_based_edit_tool") {}
|
|
300
|
+
export class TextEditor20250429Type extends /*#__PURE__*/S.Literal("text_editor_20250429") {}
|
|
301
|
+
export class TextEditor20250429 extends /*#__PURE__*/S.Struct({
|
|
302
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
303
|
+
nullable: true
|
|
304
|
+
}),
|
|
305
|
+
"name": TextEditor20250429Name,
|
|
306
|
+
"type": TextEditor20250429Type
|
|
307
|
+
}) {}
|
|
308
|
+
export class WebSearchTool20250305Name extends /*#__PURE__*/S.Literal("web_search") {}
|
|
309
|
+
export class WebSearchTool20250305Type extends /*#__PURE__*/S.Literal("web_search_20250305") {}
|
|
310
|
+
export class UserLocationType extends /*#__PURE__*/S.Literal("approximate") {}
|
|
311
|
+
export class UserLocation extends /*#__PURE__*/S.Struct({
|
|
312
|
+
"city": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
|
|
313
|
+
nullable: true
|
|
314
|
+
}),
|
|
315
|
+
"country": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(2), /*#__PURE__*/S.maxLength(2)), S.Null), {
|
|
316
|
+
nullable: true
|
|
317
|
+
}),
|
|
318
|
+
"region": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
|
|
319
|
+
nullable: true
|
|
320
|
+
}),
|
|
321
|
+
"timezone": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
|
|
322
|
+
nullable: true
|
|
323
|
+
}),
|
|
324
|
+
"type": UserLocationType
|
|
325
|
+
}) {}
|
|
326
|
+
export class WebSearchTool20250305 extends /*#__PURE__*/S.Struct({
|
|
327
|
+
"allowed_domains": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(S.String), S.Null), {
|
|
328
|
+
nullable: true
|
|
329
|
+
}),
|
|
330
|
+
"blocked_domains": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(S.String), S.Null), {
|
|
331
|
+
nullable: true
|
|
332
|
+
}),
|
|
333
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
334
|
+
nullable: true
|
|
335
|
+
}),
|
|
336
|
+
"max_uses": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThan(0)), S.Null), {
|
|
337
|
+
nullable: true
|
|
338
|
+
}),
|
|
339
|
+
"name": WebSearchTool20250305Name,
|
|
340
|
+
"type": WebSearchTool20250305Type,
|
|
341
|
+
"user_location": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(UserLocation, S.Null), {
|
|
342
|
+
nullable: true
|
|
343
|
+
})
|
|
243
344
|
}) {}
|
|
244
345
|
export class CreateMessageParams extends /*#__PURE__*/S.Class("CreateMessageParams")({
|
|
245
|
-
"model": Model,
|
|
346
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
246
347
|
"messages": /*#__PURE__*/S.Array(InputMessage),
|
|
247
348
|
"max_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
248
349
|
"metadata": /*#__PURE__*/S.optionalWith(Metadata, {
|
|
249
350
|
nullable: true
|
|
250
351
|
}),
|
|
352
|
+
"service_tier": /*#__PURE__*/S.optionalWith(CreateMessageParamsServiceTier, {
|
|
353
|
+
nullable: true
|
|
354
|
+
}),
|
|
251
355
|
"stop_sequences": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(S.String), {
|
|
252
356
|
nullable: true
|
|
253
357
|
}),
|
|
@@ -266,7 +370,7 @@ export class CreateMessageParams extends /*#__PURE__*/S.Class("CreateMessagePara
|
|
|
266
370
|
"tool_choice": /*#__PURE__*/S.optionalWith(ToolChoice, {
|
|
267
371
|
nullable: true
|
|
268
372
|
}),
|
|
269
|
-
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(Tool, BashTool20250124, TextEditor20250124)), {
|
|
373
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(Tool, BashTool20250124, TextEditor20250124, TextEditor20250429, WebSearchTool20250305)), {
|
|
270
374
|
nullable: true
|
|
271
375
|
}),
|
|
272
376
|
"top_k": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), {
|
|
@@ -278,143 +382,182 @@ export class CreateMessageParams extends /*#__PURE__*/S.Class("CreateMessagePara
|
|
|
278
382
|
}) {}
|
|
279
383
|
export class MessageType extends /*#__PURE__*/S.Literal("message") {}
|
|
280
384
|
export class MessageRole extends /*#__PURE__*/S.Literal("assistant") {}
|
|
281
|
-
export class ResponseTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
282
385
|
export class ResponseCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
|
|
283
386
|
export class ResponseCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
284
|
-
"type": /*#__PURE__*/ResponseCharLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "char_location")),
|
|
285
387
|
"cited_text": S.String,
|
|
286
388
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
287
389
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
390
|
+
"end_char_index": S.Int,
|
|
288
391
|
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
289
|
-
"
|
|
392
|
+
"type": ResponseCharLocationCitationType
|
|
290
393
|
}) {}
|
|
291
394
|
export class ResponsePageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
|
|
292
395
|
export class ResponsePageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
293
|
-
"type": /*#__PURE__*/ResponsePageLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "page_location")),
|
|
294
396
|
"cited_text": S.String,
|
|
295
397
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
296
398
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
399
|
+
"end_page_number": S.Int,
|
|
297
400
|
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
298
|
-
"
|
|
401
|
+
"type": ResponsePageLocationCitationType
|
|
299
402
|
}) {}
|
|
300
403
|
export class ResponseContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
|
|
301
404
|
export class ResponseContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
302
|
-
"type": /*#__PURE__*/ResponseContentBlockLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "content_block_location")),
|
|
303
405
|
"cited_text": S.String,
|
|
304
406
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
305
407
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
408
|
+
"end_block_index": S.Int,
|
|
306
409
|
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
307
|
-
"
|
|
410
|
+
"type": ResponseContentBlockLocationCitationType
|
|
411
|
+
}) {}
|
|
412
|
+
export class ResponseWebSearchResultLocationCitationType extends /*#__PURE__*/S.Literal("web_search_result_location") {}
|
|
413
|
+
export class ResponseWebSearchResultLocationCitation extends /*#__PURE__*/S.Struct({
|
|
414
|
+
"cited_text": S.String,
|
|
415
|
+
"encrypted_index": S.String,
|
|
416
|
+
"title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
417
|
+
"type": ResponseWebSearchResultLocationCitationType,
|
|
418
|
+
"url": S.String
|
|
308
419
|
}) {}
|
|
420
|
+
export class ResponseTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
309
421
|
export class ResponseTextBlock extends /*#__PURE__*/S.Struct({
|
|
310
|
-
"
|
|
422
|
+
"citations": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(ResponseCharLocationCitation, ResponsePageLocationCitation, ResponseContentBlockLocationCitation, ResponseWebSearchResultLocationCitation)), S.Null)),
|
|
311
423
|
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(0), /*#__PURE__*/S.maxLength(5000000)),
|
|
312
|
-
"
|
|
313
|
-
default: () => null
|
|
314
|
-
})
|
|
424
|
+
"type": ResponseTextBlockType
|
|
315
425
|
}) {}
|
|
316
426
|
export class ResponseToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
317
427
|
export class ResponseToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
318
|
-
"type": /*#__PURE__*/ResponseToolUseBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "tool_use")),
|
|
319
428
|
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
429
|
+
"input": /*#__PURE__*/S.Record({
|
|
430
|
+
key: S.String,
|
|
431
|
+
value: S.Unknown
|
|
432
|
+
}),
|
|
320
433
|
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
434
|
+
"type": ResponseToolUseBlockType
|
|
435
|
+
}) {}
|
|
436
|
+
export class ResponseServerToolUseBlockName extends /*#__PURE__*/S.Literal("web_search") {}
|
|
437
|
+
export class ResponseServerToolUseBlockType extends /*#__PURE__*/S.Literal("server_tool_use") {}
|
|
438
|
+
export class ResponseServerToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
439
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
321
440
|
"input": /*#__PURE__*/S.Record({
|
|
322
441
|
key: S.String,
|
|
323
442
|
value: S.Unknown
|
|
324
|
-
})
|
|
443
|
+
}),
|
|
444
|
+
"name": ResponseServerToolUseBlockName,
|
|
445
|
+
"type": ResponseServerToolUseBlockType
|
|
446
|
+
}) {}
|
|
447
|
+
export class ResponseWebSearchToolResultErrorType extends /*#__PURE__*/S.Literal("web_search_tool_result_error") {}
|
|
448
|
+
export class ResponseWebSearchToolResultError extends /*#__PURE__*/S.Struct({
|
|
449
|
+
"error_code": WebSearchToolResultErrorCode,
|
|
450
|
+
"type": ResponseWebSearchToolResultErrorType
|
|
451
|
+
}) {}
|
|
452
|
+
export class ResponseWebSearchResultBlockType extends /*#__PURE__*/S.Literal("web_search_result") {}
|
|
453
|
+
export class ResponseWebSearchResultBlock extends /*#__PURE__*/S.Struct({
|
|
454
|
+
"encrypted_content": S.String,
|
|
455
|
+
"page_age": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(S.String, S.Null)),
|
|
456
|
+
"title": S.String,
|
|
457
|
+
"type": ResponseWebSearchResultBlockType,
|
|
458
|
+
"url": S.String
|
|
459
|
+
}) {}
|
|
460
|
+
export class ResponseWebSearchToolResultBlockType extends /*#__PURE__*/S.Literal("web_search_tool_result") {}
|
|
461
|
+
export class ResponseWebSearchToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
462
|
+
"content": /*#__PURE__*/S.Union(ResponseWebSearchToolResultError, /*#__PURE__*/S.Array(ResponseWebSearchResultBlock)),
|
|
463
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
464
|
+
"type": ResponseWebSearchToolResultBlockType
|
|
325
465
|
}) {}
|
|
326
466
|
export class ResponseThinkingBlockType extends /*#__PURE__*/S.Literal("thinking") {}
|
|
327
467
|
export class ResponseThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
328
|
-
"
|
|
468
|
+
"signature": S.String,
|
|
329
469
|
"thinking": S.String,
|
|
330
|
-
"
|
|
470
|
+
"type": ResponseThinkingBlockType
|
|
331
471
|
}) {}
|
|
332
472
|
export class ResponseRedactedThinkingBlockType extends /*#__PURE__*/S.Literal("redacted_thinking") {}
|
|
333
473
|
export class ResponseRedactedThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
334
|
-
"
|
|
335
|
-
"
|
|
474
|
+
"data": S.String,
|
|
475
|
+
"type": ResponseRedactedThinkingBlockType
|
|
336
476
|
}) {}
|
|
337
|
-
export class ContentBlock extends /*#__PURE__*/S.Union(ResponseTextBlock, ResponseToolUseBlock, ResponseThinkingBlock, ResponseRedactedThinkingBlock) {}
|
|
338
|
-
export class
|
|
477
|
+
export class ContentBlock extends /*#__PURE__*/S.Union(ResponseTextBlock, ResponseToolUseBlock, ResponseServerToolUseBlock, ResponseWebSearchToolResultBlock, ResponseThinkingBlock, ResponseRedactedThinkingBlock) {}
|
|
478
|
+
export class StopReason extends /*#__PURE__*/S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal") {}
|
|
479
|
+
export class ServerToolUsage extends /*#__PURE__*/S.Struct({
|
|
480
|
+
"web_search_requests": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0))
|
|
481
|
+
}) {}
|
|
482
|
+
export class UsageServiceTierEnum extends /*#__PURE__*/S.Literal("standard", "priority", "batch") {}
|
|
339
483
|
export class Usage extends /*#__PURE__*/S.Struct({
|
|
484
|
+
"cache_creation_input_tokens": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)),
|
|
485
|
+
"cache_read_input_tokens": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)),
|
|
340
486
|
"input_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
341
|
-
"
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
"cache_read_input_tokens": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
|
|
345
|
-
default: () => null
|
|
346
|
-
}),
|
|
347
|
-
"output_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0))
|
|
487
|
+
"output_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
488
|
+
"server_tool_use": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(ServerToolUsage, S.Null)),
|
|
489
|
+
"service_tier": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(UsageServiceTierEnum, S.Null))
|
|
348
490
|
}) {}
|
|
349
491
|
export class Message extends /*#__PURE__*/S.Class("Message")({
|
|
350
492
|
"id": S.String,
|
|
351
|
-
"type":
|
|
352
|
-
"role":
|
|
493
|
+
"type": MessageType,
|
|
494
|
+
"role": MessageRole,
|
|
353
495
|
"content": /*#__PURE__*/S.Array(ContentBlock),
|
|
354
|
-
"model": Model,
|
|
355
|
-
"stop_reason": /*#__PURE__*/S.Union(
|
|
356
|
-
"stop_sequence": /*#__PURE__*/S.
|
|
357
|
-
default: () => null
|
|
358
|
-
}),
|
|
496
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
497
|
+
"stop_reason": /*#__PURE__*/S.Union(StopReason, S.Null),
|
|
498
|
+
"stop_sequence": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(S.String, S.Null)),
|
|
359
499
|
"usage": Usage
|
|
360
500
|
}) {}
|
|
361
|
-
export class ErrorResponseType extends /*#__PURE__*/S.Literal("error") {}
|
|
362
501
|
export class InvalidRequestErrorType extends /*#__PURE__*/S.Literal("invalid_request_error") {}
|
|
363
502
|
export class InvalidRequestError extends /*#__PURE__*/S.Struct({
|
|
364
|
-
"
|
|
365
|
-
"
|
|
503
|
+
"message": S.String,
|
|
504
|
+
"type": InvalidRequestErrorType
|
|
366
505
|
}) {}
|
|
367
506
|
export class AuthenticationErrorType extends /*#__PURE__*/S.Literal("authentication_error") {}
|
|
368
507
|
export class AuthenticationError extends /*#__PURE__*/S.Struct({
|
|
369
|
-
"
|
|
370
|
-
"
|
|
508
|
+
"message": S.String,
|
|
509
|
+
"type": AuthenticationErrorType
|
|
371
510
|
}) {}
|
|
372
511
|
export class BillingErrorType extends /*#__PURE__*/S.Literal("billing_error") {}
|
|
373
512
|
export class BillingError extends /*#__PURE__*/S.Struct({
|
|
374
|
-
"
|
|
375
|
-
"
|
|
513
|
+
"message": S.String,
|
|
514
|
+
"type": BillingErrorType
|
|
376
515
|
}) {}
|
|
377
516
|
export class PermissionErrorType extends /*#__PURE__*/S.Literal("permission_error") {}
|
|
378
517
|
export class PermissionError extends /*#__PURE__*/S.Struct({
|
|
379
|
-
"
|
|
380
|
-
"
|
|
518
|
+
"message": S.String,
|
|
519
|
+
"type": PermissionErrorType
|
|
381
520
|
}) {}
|
|
382
521
|
export class NotFoundErrorType extends /*#__PURE__*/S.Literal("not_found_error") {}
|
|
383
522
|
export class NotFoundError extends /*#__PURE__*/S.Struct({
|
|
384
|
-
"
|
|
385
|
-
"
|
|
523
|
+
"message": S.String,
|
|
524
|
+
"type": NotFoundErrorType
|
|
386
525
|
}) {}
|
|
387
526
|
export class RateLimitErrorType extends /*#__PURE__*/S.Literal("rate_limit_error") {}
|
|
388
527
|
export class RateLimitError extends /*#__PURE__*/S.Struct({
|
|
389
|
-
"
|
|
390
|
-
"
|
|
528
|
+
"message": S.String,
|
|
529
|
+
"type": RateLimitErrorType
|
|
391
530
|
}) {}
|
|
392
531
|
export class GatewayTimeoutErrorType extends /*#__PURE__*/S.Literal("timeout_error") {}
|
|
393
532
|
export class GatewayTimeoutError extends /*#__PURE__*/S.Struct({
|
|
394
|
-
"
|
|
395
|
-
"
|
|
533
|
+
"message": S.String,
|
|
534
|
+
"type": GatewayTimeoutErrorType
|
|
396
535
|
}) {}
|
|
397
536
|
export class APIErrorType extends /*#__PURE__*/S.Literal("api_error") {}
|
|
398
537
|
export class APIError extends /*#__PURE__*/S.Struct({
|
|
399
|
-
"
|
|
400
|
-
"
|
|
538
|
+
"message": S.String,
|
|
539
|
+
"type": APIErrorType
|
|
401
540
|
}) {}
|
|
402
541
|
export class OverloadedErrorType extends /*#__PURE__*/S.Literal("overloaded_error") {}
|
|
403
542
|
export class OverloadedError extends /*#__PURE__*/S.Struct({
|
|
404
|
-
"
|
|
405
|
-
"
|
|
543
|
+
"message": S.String,
|
|
544
|
+
"type": OverloadedErrorType
|
|
406
545
|
}) {}
|
|
546
|
+
export class ErrorResponseType extends /*#__PURE__*/S.Literal("error") {}
|
|
407
547
|
export class ErrorResponse extends /*#__PURE__*/S.Class("ErrorResponse")({
|
|
408
|
-
"
|
|
409
|
-
"
|
|
548
|
+
"error": /*#__PURE__*/S.Union(InvalidRequestError, AuthenticationError, BillingError, PermissionError, NotFoundError, RateLimitError, GatewayTimeoutError, APIError, OverloadedError),
|
|
549
|
+
"type": ErrorResponseType
|
|
410
550
|
}) {}
|
|
411
551
|
export class CompletePostParams extends /*#__PURE__*/S.Struct({
|
|
412
552
|
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
413
553
|
nullable: true
|
|
554
|
+
}),
|
|
555
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
556
|
+
nullable: true
|
|
414
557
|
})
|
|
415
558
|
}) {}
|
|
416
559
|
export class CompletionRequest extends /*#__PURE__*/S.Class("CompletionRequest")({
|
|
417
|
-
"model": Model,
|
|
560
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
418
561
|
"prompt": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
419
562
|
"max_tokens_to_sample": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
420
563
|
"stop_sequences": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(S.String), {
|
|
@@ -438,11 +581,11 @@ export class CompletionRequest extends /*#__PURE__*/S.Class("CompletionRequest")
|
|
|
438
581
|
}) {}
|
|
439
582
|
export class CompletionResponseType extends /*#__PURE__*/S.Literal("completion") {}
|
|
440
583
|
export class CompletionResponse extends /*#__PURE__*/S.Class("CompletionResponse")({
|
|
441
|
-
"type": /*#__PURE__*/CompletionResponseType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "completion")),
|
|
442
|
-
"id": S.String,
|
|
443
584
|
"completion": S.String,
|
|
585
|
+
"id": S.String,
|
|
586
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
444
587
|
"stop_reason": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
445
|
-
"
|
|
588
|
+
"type": CompletionResponseType
|
|
446
589
|
}) {}
|
|
447
590
|
export class ModelsListParams extends /*#__PURE__*/S.Struct({
|
|
448
591
|
"before_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
@@ -452,27 +595,29 @@ export class ModelsListParams extends /*#__PURE__*/S.Struct({
|
|
|
452
595
|
nullable: true
|
|
453
596
|
}),
|
|
454
597
|
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
455
|
-
nullable: true
|
|
456
|
-
default: () => 20
|
|
598
|
+
nullable: true
|
|
457
599
|
}),
|
|
458
600
|
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
459
601
|
nullable: true
|
|
460
602
|
}),
|
|
461
603
|
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
462
604
|
nullable: true
|
|
605
|
+
}),
|
|
606
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
607
|
+
nullable: true
|
|
463
608
|
})
|
|
464
609
|
}) {}
|
|
465
610
|
export class ModelInfoType extends /*#__PURE__*/S.Literal("model") {}
|
|
466
611
|
export class ModelInfo extends /*#__PURE__*/S.Struct({
|
|
467
|
-
"
|
|
468
|
-
"id": S.String,
|
|
612
|
+
"created_at": S.String,
|
|
469
613
|
"display_name": S.String,
|
|
470
|
-
"
|
|
614
|
+
"id": S.String,
|
|
615
|
+
"type": ModelInfoType
|
|
471
616
|
}) {}
|
|
472
617
|
export class ListResponseModelInfo extends /*#__PURE__*/S.Class("ListResponseModelInfo")({
|
|
473
618
|
"data": /*#__PURE__*/S.Array(ModelInfo),
|
|
474
|
-
"has_more": S.Boolean,
|
|
475
619
|
"first_id": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
620
|
+
"has_more": S.Boolean,
|
|
476
621
|
"last_id": /*#__PURE__*/S.Union(S.String, S.Null)
|
|
477
622
|
}) {}
|
|
478
623
|
export class ModelsGetParams extends /*#__PURE__*/S.Struct({
|
|
@@ -481,6 +626,9 @@ export class ModelsGetParams extends /*#__PURE__*/S.Struct({
|
|
|
481
626
|
}),
|
|
482
627
|
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
483
628
|
nullable: true
|
|
629
|
+
}),
|
|
630
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
631
|
+
nullable: true
|
|
484
632
|
})
|
|
485
633
|
}) {}
|
|
486
634
|
export class MessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
@@ -491,8 +639,7 @@ export class MessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
|
491
639
|
nullable: true
|
|
492
640
|
}),
|
|
493
641
|
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
494
|
-
nullable: true
|
|
495
|
-
default: () => 20
|
|
642
|
+
nullable: true
|
|
496
643
|
}),
|
|
497
644
|
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
498
645
|
nullable: true
|
|
@@ -501,31 +648,31 @@ export class MessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
|
501
648
|
nullable: true
|
|
502
649
|
})
|
|
503
650
|
}) {}
|
|
504
|
-
export class MessageBatchType extends /*#__PURE__*/S.Literal("message_batch") {}
|
|
505
651
|
export class MessageBatchProcessingStatus extends /*#__PURE__*/S.Literal("in_progress", "canceling", "ended") {}
|
|
506
652
|
export class RequestCounts extends /*#__PURE__*/S.Struct({
|
|
507
|
-
"
|
|
508
|
-
"
|
|
509
|
-
"
|
|
510
|
-
"
|
|
511
|
-
"
|
|
653
|
+
"canceled": S.Int,
|
|
654
|
+
"errored": S.Int,
|
|
655
|
+
"expired": S.Int,
|
|
656
|
+
"processing": S.Int,
|
|
657
|
+
"succeeded": S.Int
|
|
512
658
|
}) {}
|
|
659
|
+
export class MessageBatchType extends /*#__PURE__*/S.Literal("message_batch") {}
|
|
513
660
|
export class MessageBatch extends /*#__PURE__*/S.Struct({
|
|
661
|
+
"archived_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
662
|
+
"cancel_initiated_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
663
|
+
"created_at": S.String,
|
|
664
|
+
"ended_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
665
|
+
"expires_at": S.String,
|
|
514
666
|
"id": S.String,
|
|
515
|
-
"type": /*#__PURE__*/MessageBatchType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message_batch")),
|
|
516
667
|
"processing_status": MessageBatchProcessingStatus,
|
|
517
668
|
"request_counts": RequestCounts,
|
|
518
|
-
"
|
|
519
|
-
"
|
|
520
|
-
"expires_at": S.String,
|
|
521
|
-
"archived_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
522
|
-
"cancel_initiated_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
523
|
-
"results_url": /*#__PURE__*/S.Union(S.String, S.Null)
|
|
669
|
+
"results_url": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
670
|
+
"type": MessageBatchType
|
|
524
671
|
}) {}
|
|
525
672
|
export class ListResponseMessageBatch extends /*#__PURE__*/S.Class("ListResponseMessageBatch")({
|
|
526
673
|
"data": /*#__PURE__*/S.Array(MessageBatch),
|
|
527
|
-
"has_more": S.Boolean,
|
|
528
674
|
"first_id": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
675
|
+
"has_more": S.Boolean,
|
|
529
676
|
"last_id": /*#__PURE__*/S.Union(S.String, S.Null)
|
|
530
677
|
}) {}
|
|
531
678
|
export class MessageBatchesPostParams extends /*#__PURE__*/S.Struct({
|
|
@@ -559,7 +706,7 @@ export class MessageBatchesDeleteParams extends /*#__PURE__*/S.Struct({
|
|
|
559
706
|
export class DeleteMessageBatchResponseType extends /*#__PURE__*/S.Literal("message_batch_deleted") {}
|
|
560
707
|
export class DeleteMessageBatchResponse extends /*#__PURE__*/S.Class("DeleteMessageBatchResponse")({
|
|
561
708
|
"id": S.String,
|
|
562
|
-
"type":
|
|
709
|
+
"type": DeleteMessageBatchResponseType
|
|
563
710
|
}) {}
|
|
564
711
|
export class MessageBatchesCancelParams extends /*#__PURE__*/S.Struct({
|
|
565
712
|
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
@@ -580,24 +727,116 @@ export class MessagesCountTokensPostParams extends /*#__PURE__*/S.Struct({
|
|
|
580
727
|
})
|
|
581
728
|
}) {}
|
|
582
729
|
export class CountMessageTokensParams extends /*#__PURE__*/S.Class("CountMessageTokensParams")({
|
|
583
|
-
"tool_choice": /*#__PURE__*/S.optionalWith(ToolChoice, {
|
|
584
|
-
nullable: true
|
|
585
|
-
}),
|
|
586
|
-
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(Tool, BashTool20250124, TextEditor20250124)), {
|
|
587
|
-
nullable: true
|
|
588
|
-
}),
|
|
589
730
|
"messages": /*#__PURE__*/S.Array(InputMessage),
|
|
731
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
590
732
|
"system": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(RequestTextBlock)), {
|
|
591
733
|
nullable: true
|
|
592
734
|
}),
|
|
593
735
|
"thinking": /*#__PURE__*/S.optionalWith(ThinkingConfigParam, {
|
|
594
736
|
nullable: true
|
|
595
737
|
}),
|
|
596
|
-
"
|
|
738
|
+
"tool_choice": /*#__PURE__*/S.optionalWith(ToolChoice, {
|
|
739
|
+
nullable: true
|
|
740
|
+
}),
|
|
741
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(Tool, BashTool20250124, TextEditor20250124, TextEditor20250429, WebSearchTool20250305)), {
|
|
742
|
+
nullable: true
|
|
743
|
+
})
|
|
597
744
|
}) {}
|
|
598
745
|
export class CountMessageTokensResponse extends /*#__PURE__*/S.Class("CountMessageTokensResponse")({
|
|
599
746
|
"input_tokens": S.Int
|
|
600
747
|
}) {}
|
|
748
|
+
export class ListFilesV1FilesGetParams extends /*#__PURE__*/S.Struct({
|
|
749
|
+
"before_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
750
|
+
nullable: true
|
|
751
|
+
}),
|
|
752
|
+
"after_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
753
|
+
nullable: true
|
|
754
|
+
}),
|
|
755
|
+
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
756
|
+
nullable: true
|
|
757
|
+
}),
|
|
758
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
759
|
+
nullable: true
|
|
760
|
+
}),
|
|
761
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
762
|
+
nullable: true
|
|
763
|
+
}),
|
|
764
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
765
|
+
nullable: true
|
|
766
|
+
})
|
|
767
|
+
}) {}
|
|
768
|
+
export class FileMetadataSchemaType extends /*#__PURE__*/S.Literal("file") {}
|
|
769
|
+
export class FileMetadataSchema extends /*#__PURE__*/S.Struct({
|
|
770
|
+
"created_at": S.String,
|
|
771
|
+
"downloadable": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
772
|
+
nullable: true
|
|
773
|
+
}),
|
|
774
|
+
"filename": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)),
|
|
775
|
+
"id": S.String,
|
|
776
|
+
"mime_type": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)),
|
|
777
|
+
"size_bytes": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
778
|
+
"type": FileMetadataSchemaType
|
|
779
|
+
}) {}
|
|
780
|
+
export class FileListResponse extends /*#__PURE__*/S.Class("FileListResponse")({
|
|
781
|
+
"data": /*#__PURE__*/S.Array(FileMetadataSchema),
|
|
782
|
+
"first_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
783
|
+
nullable: true
|
|
784
|
+
}),
|
|
785
|
+
"has_more": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
786
|
+
nullable: true
|
|
787
|
+
}),
|
|
788
|
+
"last_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
789
|
+
nullable: true
|
|
790
|
+
})
|
|
791
|
+
}) {}
|
|
792
|
+
export class UploadFileV1FilesPostParams extends /*#__PURE__*/S.Struct({
|
|
793
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
794
|
+
nullable: true
|
|
795
|
+
}),
|
|
796
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
797
|
+
nullable: true
|
|
798
|
+
})
|
|
799
|
+
}) {}
|
|
800
|
+
export class GetFileMetadataV1FilesFileIdGetParams extends /*#__PURE__*/S.Struct({
|
|
801
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
802
|
+
nullable: true
|
|
803
|
+
}),
|
|
804
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
805
|
+
nullable: true
|
|
806
|
+
}),
|
|
807
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
808
|
+
nullable: true
|
|
809
|
+
})
|
|
810
|
+
}) {}
|
|
811
|
+
export class DeleteFileV1FilesFileIdDeleteParams extends /*#__PURE__*/S.Struct({
|
|
812
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
813
|
+
nullable: true
|
|
814
|
+
}),
|
|
815
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
816
|
+
nullable: true
|
|
817
|
+
}),
|
|
818
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
819
|
+
nullable: true
|
|
820
|
+
})
|
|
821
|
+
}) {}
|
|
822
|
+
export class FileDeleteResponseType extends /*#__PURE__*/S.Literal("file_deleted") {}
|
|
823
|
+
export class FileDeleteResponse extends /*#__PURE__*/S.Class("FileDeleteResponse")({
|
|
824
|
+
"id": S.String,
|
|
825
|
+
"type": /*#__PURE__*/S.optionalWith(FileDeleteResponseType, {
|
|
826
|
+
nullable: true
|
|
827
|
+
})
|
|
828
|
+
}) {}
|
|
829
|
+
export class DownloadFileV1FilesFileIdContentGetParams extends /*#__PURE__*/S.Struct({
|
|
830
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
831
|
+
nullable: true
|
|
832
|
+
}),
|
|
833
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
834
|
+
nullable: true
|
|
835
|
+
}),
|
|
836
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
837
|
+
nullable: true
|
|
838
|
+
})
|
|
839
|
+
}) {}
|
|
601
840
|
export class BetaMessagesPostParams extends /*#__PURE__*/S.Struct({
|
|
602
841
|
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
603
842
|
nullable: true
|
|
@@ -606,167 +845,313 @@ export class BetaMessagesPostParams extends /*#__PURE__*/S.Struct({
|
|
|
606
845
|
nullable: true
|
|
607
846
|
})
|
|
608
847
|
}) {}
|
|
609
|
-
export class
|
|
848
|
+
export class BetaCacheControlEphemeralTtl extends /*#__PURE__*/S.Literal("5m", "1h") {}
|
|
610
849
|
export class BetaCacheControlEphemeralType extends /*#__PURE__*/S.Literal("ephemeral") {}
|
|
611
850
|
export class BetaCacheControlEphemeral extends /*#__PURE__*/S.Struct({
|
|
851
|
+
"ttl": /*#__PURE__*/S.optionalWith(BetaCacheControlEphemeralTtl, {
|
|
852
|
+
nullable: true
|
|
853
|
+
}),
|
|
612
854
|
"type": BetaCacheControlEphemeralType
|
|
613
855
|
}) {}
|
|
856
|
+
export class BetaRequestServerToolUseBlockName extends /*#__PURE__*/S.Literal("web_search", "code_execution") {}
|
|
857
|
+
export class BetaRequestServerToolUseBlockType extends /*#__PURE__*/S.Literal("server_tool_use") {}
|
|
858
|
+
export class BetaRequestServerToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
859
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
860
|
+
nullable: true
|
|
861
|
+
}),
|
|
862
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
863
|
+
"input": /*#__PURE__*/S.Record({
|
|
864
|
+
key: S.String,
|
|
865
|
+
value: S.Unknown
|
|
866
|
+
}),
|
|
867
|
+
"name": BetaRequestServerToolUseBlockName,
|
|
868
|
+
"type": BetaRequestServerToolUseBlockType
|
|
869
|
+
}) {}
|
|
870
|
+
export class BetaRequestWebSearchResultBlockType extends /*#__PURE__*/S.Literal("web_search_result") {}
|
|
871
|
+
export class BetaRequestWebSearchResultBlock extends /*#__PURE__*/S.Struct({
|
|
872
|
+
"encrypted_content": S.String,
|
|
873
|
+
"page_age": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
874
|
+
nullable: true
|
|
875
|
+
}),
|
|
876
|
+
"title": S.String,
|
|
877
|
+
"type": BetaRequestWebSearchResultBlockType,
|
|
878
|
+
"url": S.String
|
|
879
|
+
}) {}
|
|
880
|
+
export class BetaWebSearchToolResultErrorCode extends /*#__PURE__*/S.Literal("invalid_tool_input", "unavailable", "max_uses_exceeded", "too_many_requests", "query_too_long") {}
|
|
881
|
+
export class BetaRequestWebSearchToolResultErrorType extends /*#__PURE__*/S.Literal("web_search_tool_result_error") {}
|
|
882
|
+
export class BetaRequestWebSearchToolResultError extends /*#__PURE__*/S.Struct({
|
|
883
|
+
"error_code": BetaWebSearchToolResultErrorCode,
|
|
884
|
+
"type": BetaRequestWebSearchToolResultErrorType
|
|
885
|
+
}) {}
|
|
886
|
+
export class BetaRequestWebSearchToolResultBlockType extends /*#__PURE__*/S.Literal("web_search_tool_result") {}
|
|
887
|
+
export class BetaRequestWebSearchToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
888
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
889
|
+
nullable: true
|
|
890
|
+
}),
|
|
891
|
+
"content": /*#__PURE__*/S.Union(/*#__PURE__*/S.Array(BetaRequestWebSearchResultBlock), BetaRequestWebSearchToolResultError),
|
|
892
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
893
|
+
"type": BetaRequestWebSearchToolResultBlockType
|
|
894
|
+
}) {}
|
|
895
|
+
export class BetaCodeExecutionToolResultErrorCode extends /*#__PURE__*/S.Literal("invalid_tool_input", "unavailable", "too_many_requests", "execution_time_exceeded") {}
|
|
896
|
+
export class BetaRequestCodeExecutionToolResultErrorType extends /*#__PURE__*/S.Literal("code_execution_tool_result_error") {}
|
|
897
|
+
export class BetaRequestCodeExecutionToolResultError extends /*#__PURE__*/S.Struct({
|
|
898
|
+
"error_code": BetaCodeExecutionToolResultErrorCode,
|
|
899
|
+
"type": BetaRequestCodeExecutionToolResultErrorType
|
|
900
|
+
}) {}
|
|
901
|
+
export class BetaRequestCodeExecutionOutputBlockType extends /*#__PURE__*/S.Literal("code_execution_output") {}
|
|
902
|
+
export class BetaRequestCodeExecutionOutputBlock extends /*#__PURE__*/S.Struct({
|
|
903
|
+
"file_id": S.String,
|
|
904
|
+
"type": BetaRequestCodeExecutionOutputBlockType
|
|
905
|
+
}) {}
|
|
906
|
+
export class BetaRequestCodeExecutionResultBlockType extends /*#__PURE__*/S.Literal("code_execution_result") {}
|
|
907
|
+
export class BetaRequestCodeExecutionResultBlock extends /*#__PURE__*/S.Struct({
|
|
908
|
+
"content": /*#__PURE__*/S.Array(BetaRequestCodeExecutionOutputBlock),
|
|
909
|
+
"return_code": S.Int,
|
|
910
|
+
"stderr": S.String,
|
|
911
|
+
"stdout": S.String,
|
|
912
|
+
"type": BetaRequestCodeExecutionResultBlockType
|
|
913
|
+
}) {}
|
|
914
|
+
export class BetaRequestCodeExecutionToolResultBlockType extends /*#__PURE__*/S.Literal("code_execution_tool_result") {}
|
|
915
|
+
export class BetaRequestCodeExecutionToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
916
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
917
|
+
nullable: true
|
|
918
|
+
}),
|
|
919
|
+
"content": /*#__PURE__*/S.Union(BetaRequestCodeExecutionToolResultError, BetaRequestCodeExecutionResultBlock),
|
|
920
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
921
|
+
"type": BetaRequestCodeExecutionToolResultBlockType
|
|
922
|
+
}) {}
|
|
923
|
+
export class BetaRequestMCPToolUseBlockType extends /*#__PURE__*/S.Literal("mcp_tool_use") {}
|
|
924
|
+
export class BetaRequestMCPToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
925
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
926
|
+
nullable: true
|
|
927
|
+
}),
|
|
928
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
929
|
+
"input": /*#__PURE__*/S.Record({
|
|
930
|
+
key: S.String,
|
|
931
|
+
value: S.Unknown
|
|
932
|
+
}),
|
|
933
|
+
"name": S.String,
|
|
934
|
+
"server_name": S.String,
|
|
935
|
+
"type": BetaRequestMCPToolUseBlockType
|
|
936
|
+
}) {}
|
|
614
937
|
export class BetaRequestCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
|
|
615
938
|
export class BetaRequestCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
616
|
-
"type": BetaRequestCharLocationCitationType,
|
|
617
939
|
"cited_text": S.String,
|
|
618
940
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
619
941
|
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
942
|
+
"end_char_index": S.Int,
|
|
620
943
|
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
621
|
-
"
|
|
944
|
+
"type": BetaRequestCharLocationCitationType
|
|
622
945
|
}) {}
|
|
623
946
|
export class BetaRequestPageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
|
|
624
947
|
export class BetaRequestPageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
625
|
-
"type": BetaRequestPageLocationCitationType,
|
|
626
948
|
"cited_text": S.String,
|
|
627
949
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
628
950
|
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
951
|
+
"end_page_number": S.Int,
|
|
629
952
|
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
630
|
-
"
|
|
953
|
+
"type": BetaRequestPageLocationCitationType
|
|
631
954
|
}) {}
|
|
632
955
|
export class BetaRequestContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
|
|
633
956
|
export class BetaRequestContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
634
|
-
"type": BetaRequestContentBlockLocationCitationType,
|
|
635
957
|
"cited_text": S.String,
|
|
636
958
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
637
959
|
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
960
|
+
"end_block_index": S.Int,
|
|
638
961
|
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
639
|
-
"
|
|
962
|
+
"type": BetaRequestContentBlockLocationCitationType
|
|
963
|
+
}) {}
|
|
964
|
+
export class BetaRequestWebSearchResultLocationCitationType extends /*#__PURE__*/S.Literal("web_search_result_location") {}
|
|
965
|
+
export class BetaRequestWebSearchResultLocationCitation extends /*#__PURE__*/S.Struct({
|
|
966
|
+
"cited_text": S.String,
|
|
967
|
+
"encrypted_index": S.String,
|
|
968
|
+
"title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
969
|
+
"type": BetaRequestWebSearchResultLocationCitationType,
|
|
970
|
+
"url": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(2048))
|
|
640
971
|
}) {}
|
|
641
972
|
export class BetaRequestTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
642
973
|
export class BetaRequestTextBlock extends /*#__PURE__*/S.Struct({
|
|
643
974
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
644
975
|
nullable: true
|
|
645
976
|
}),
|
|
646
|
-
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaRequestCharLocationCitation, BetaRequestPageLocationCitation, BetaRequestContentBlockLocationCitation)), S.Null), {
|
|
977
|
+
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaRequestCharLocationCitation, BetaRequestPageLocationCitation, BetaRequestContentBlockLocationCitation, BetaRequestWebSearchResultLocationCitation)), S.Null), {
|
|
647
978
|
nullable: true
|
|
648
979
|
}),
|
|
649
980
|
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
650
981
|
"type": BetaRequestTextBlockType
|
|
651
982
|
}) {}
|
|
652
|
-
export class
|
|
653
|
-
export class
|
|
983
|
+
export class BetaRequestMCPToolResultBlockType extends /*#__PURE__*/S.Literal("mcp_tool_result") {}
|
|
984
|
+
export class BetaRequestMCPToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
985
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
986
|
+
nullable: true
|
|
987
|
+
}),
|
|
988
|
+
"content": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaRequestTextBlock)), {
|
|
989
|
+
nullable: true
|
|
990
|
+
}),
|
|
991
|
+
"is_error": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
992
|
+
nullable: true
|
|
993
|
+
}),
|
|
994
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
995
|
+
"type": BetaRequestMCPToolResultBlockType
|
|
996
|
+
}) {}
|
|
654
997
|
export class BetaBase64ImageSourceMediaType extends /*#__PURE__*/S.Literal("image/jpeg", "image/png", "image/gif", "image/webp") {}
|
|
998
|
+
export class BetaBase64ImageSourceType extends /*#__PURE__*/S.Literal("base64") {}
|
|
655
999
|
export class BetaBase64ImageSource extends /*#__PURE__*/S.Struct({
|
|
656
|
-
"
|
|
1000
|
+
"data": S.String,
|
|
657
1001
|
"media_type": BetaBase64ImageSourceMediaType,
|
|
658
|
-
"
|
|
1002
|
+
"type": BetaBase64ImageSourceType
|
|
659
1003
|
}) {}
|
|
660
1004
|
export class BetaURLImageSourceType extends /*#__PURE__*/S.Literal("url") {}
|
|
661
1005
|
export class BetaURLImageSource extends /*#__PURE__*/S.Struct({
|
|
662
1006
|
"type": BetaURLImageSourceType,
|
|
663
1007
|
"url": S.String
|
|
664
1008
|
}) {}
|
|
1009
|
+
export class BetaFileImageSourceType extends /*#__PURE__*/S.Literal("file") {}
|
|
1010
|
+
export class BetaFileImageSource extends /*#__PURE__*/S.Struct({
|
|
1011
|
+
"file_id": S.String,
|
|
1012
|
+
"type": BetaFileImageSourceType
|
|
1013
|
+
}) {}
|
|
1014
|
+
export class BetaRequestImageBlockType extends /*#__PURE__*/S.Literal("image") {}
|
|
665
1015
|
export class BetaRequestImageBlock extends /*#__PURE__*/S.Struct({
|
|
666
1016
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
667
1017
|
nullable: true
|
|
668
1018
|
}),
|
|
669
|
-
"
|
|
670
|
-
"
|
|
1019
|
+
"source": /*#__PURE__*/S.Union(BetaBase64ImageSource, BetaURLImageSource, BetaFileImageSource),
|
|
1020
|
+
"type": BetaRequestImageBlockType
|
|
671
1021
|
}) {}
|
|
672
1022
|
export class BetaRequestToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
673
1023
|
export class BetaRequestToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
674
1024
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
675
1025
|
nullable: true
|
|
676
1026
|
}),
|
|
677
|
-
"type": BetaRequestToolUseBlockType,
|
|
678
1027
|
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
679
|
-
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(64), /*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]{1,64}$"))),
|
|
680
1028
|
"input": /*#__PURE__*/S.Record({
|
|
681
1029
|
key: S.String,
|
|
682
1030
|
value: S.Unknown
|
|
683
|
-
})
|
|
1031
|
+
}),
|
|
1032
|
+
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(200)),
|
|
1033
|
+
"type": BetaRequestToolUseBlockType
|
|
684
1034
|
}) {}
|
|
685
1035
|
export class BetaRequestToolResultBlockType extends /*#__PURE__*/S.Literal("tool_result") {}
|
|
686
1036
|
export class BetaRequestToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
687
1037
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
688
1038
|
nullable: true
|
|
689
1039
|
}),
|
|
690
|
-
"
|
|
691
|
-
|
|
1040
|
+
"content": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock))), {
|
|
1041
|
+
nullable: true
|
|
1042
|
+
}),
|
|
692
1043
|
"is_error": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
693
1044
|
nullable: true
|
|
694
1045
|
}),
|
|
695
|
-
"
|
|
1046
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
1047
|
+
"type": BetaRequestToolResultBlockType
|
|
1048
|
+
}) {}
|
|
1049
|
+
export class BetaRequestCitationsConfig extends /*#__PURE__*/S.Struct({
|
|
1050
|
+
"enabled": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
696
1051
|
nullable: true
|
|
697
1052
|
})
|
|
698
1053
|
}) {}
|
|
699
|
-
export class BetaRequestDocumentBlockType extends /*#__PURE__*/S.Literal("document") {}
|
|
700
|
-
export class BetaBase64PDFSourceType extends /*#__PURE__*/S.Literal("base64") {}
|
|
701
1054
|
export class BetaBase64PDFSourceMediaType extends /*#__PURE__*/S.Literal("application/pdf") {}
|
|
1055
|
+
export class BetaBase64PDFSourceType extends /*#__PURE__*/S.Literal("base64") {}
|
|
702
1056
|
export class BetaBase64PDFSource extends /*#__PURE__*/S.Struct({
|
|
703
|
-
"
|
|
1057
|
+
"data": S.String,
|
|
704
1058
|
"media_type": BetaBase64PDFSourceMediaType,
|
|
705
|
-
"
|
|
1059
|
+
"type": BetaBase64PDFSourceType
|
|
706
1060
|
}) {}
|
|
707
|
-
export class BetaPlainTextSourceType extends /*#__PURE__*/S.Literal("text") {}
|
|
708
1061
|
export class BetaPlainTextSourceMediaType extends /*#__PURE__*/S.Literal("text/plain") {}
|
|
1062
|
+
export class BetaPlainTextSourceType extends /*#__PURE__*/S.Literal("text") {}
|
|
709
1063
|
export class BetaPlainTextSource extends /*#__PURE__*/S.Struct({
|
|
710
|
-
"
|
|
1064
|
+
"data": S.String,
|
|
711
1065
|
"media_type": BetaPlainTextSourceMediaType,
|
|
712
|
-
"
|
|
1066
|
+
"type": BetaPlainTextSourceType
|
|
713
1067
|
}) {}
|
|
714
1068
|
export class BetaContentBlockSourceType extends /*#__PURE__*/S.Literal("content") {}
|
|
715
1069
|
export class BetaContentBlockSource extends /*#__PURE__*/S.Struct({
|
|
716
|
-
"
|
|
717
|
-
"
|
|
1070
|
+
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock))),
|
|
1071
|
+
"type": BetaContentBlockSourceType
|
|
718
1072
|
}) {}
|
|
719
1073
|
export class BetaURLPDFSourceType extends /*#__PURE__*/S.Literal("url") {}
|
|
720
1074
|
export class BetaURLPDFSource extends /*#__PURE__*/S.Struct({
|
|
721
1075
|
"type": BetaURLPDFSourceType,
|
|
722
1076
|
"url": S.String
|
|
723
1077
|
}) {}
|
|
724
|
-
export class
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
1078
|
+
export class BetaFileDocumentSourceType extends /*#__PURE__*/S.Literal("file") {}
|
|
1079
|
+
export class BetaFileDocumentSource extends /*#__PURE__*/S.Struct({
|
|
1080
|
+
"file_id": S.String,
|
|
1081
|
+
"type": BetaFileDocumentSourceType
|
|
728
1082
|
}) {}
|
|
1083
|
+
export class BetaRequestDocumentBlockType extends /*#__PURE__*/S.Literal("document") {}
|
|
729
1084
|
export class BetaRequestDocumentBlock extends /*#__PURE__*/S.Struct({
|
|
730
1085
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
731
1086
|
nullable: true
|
|
732
1087
|
}),
|
|
733
|
-
"
|
|
734
|
-
"source": /*#__PURE__*/S.Union(BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource, BetaURLPDFSource),
|
|
735
|
-
"title": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)), S.Null), {
|
|
1088
|
+
"citations": /*#__PURE__*/S.optionalWith(BetaRequestCitationsConfig, {
|
|
736
1089
|
nullable: true
|
|
737
1090
|
}),
|
|
738
1091
|
"context": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)), S.Null), {
|
|
739
1092
|
nullable: true
|
|
740
1093
|
}),
|
|
741
|
-
"
|
|
1094
|
+
"source": /*#__PURE__*/S.Union(BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource, BetaURLPDFSource, BetaFileDocumentSource),
|
|
1095
|
+
"title": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)), S.Null), {
|
|
742
1096
|
nullable: true
|
|
743
|
-
})
|
|
1097
|
+
}),
|
|
1098
|
+
"type": BetaRequestDocumentBlockType
|
|
744
1099
|
}) {}
|
|
745
1100
|
export class BetaRequestThinkingBlockType extends /*#__PURE__*/S.Literal("thinking") {}
|
|
746
1101
|
export class BetaRequestThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
747
|
-
"
|
|
1102
|
+
"signature": S.String,
|
|
748
1103
|
"thinking": S.String,
|
|
749
|
-
"
|
|
1104
|
+
"type": BetaRequestThinkingBlockType
|
|
750
1105
|
}) {}
|
|
751
1106
|
export class BetaRequestRedactedThinkingBlockType extends /*#__PURE__*/S.Literal("redacted_thinking") {}
|
|
752
1107
|
export class BetaRequestRedactedThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
753
|
-
"
|
|
754
|
-
"
|
|
1108
|
+
"data": S.String,
|
|
1109
|
+
"type": BetaRequestRedactedThinkingBlockType
|
|
1110
|
+
}) {}
|
|
1111
|
+
export class BetaRequestContainerUploadBlockType extends /*#__PURE__*/S.Literal("container_upload") {}
|
|
1112
|
+
export class BetaRequestContainerUploadBlock extends /*#__PURE__*/S.Struct({
|
|
1113
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1114
|
+
nullable: true
|
|
1115
|
+
}),
|
|
1116
|
+
"file_id": S.String,
|
|
1117
|
+
"type": BetaRequestContainerUploadBlockType
|
|
755
1118
|
}) {}
|
|
756
|
-
export class BetaInputContentBlock extends /*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock, BetaRequestToolUseBlock, BetaRequestToolResultBlock, BetaRequestDocumentBlock, BetaRequestThinkingBlock, BetaRequestRedactedThinkingBlock) {}
|
|
1119
|
+
export class BetaInputContentBlock extends /*#__PURE__*/S.Union(BetaRequestServerToolUseBlock, BetaRequestWebSearchToolResultBlock, BetaRequestCodeExecutionToolResultBlock, BetaRequestMCPToolUseBlock, BetaRequestMCPToolResultBlock, BetaRequestTextBlock, BetaRequestImageBlock, BetaRequestToolUseBlock, BetaRequestToolResultBlock, BetaRequestDocumentBlock, BetaRequestThinkingBlock, BetaRequestRedactedThinkingBlock, BetaRequestContainerUploadBlock) {}
|
|
1120
|
+
export class BetaInputMessageRole extends /*#__PURE__*/S.Literal("user", "assistant") {}
|
|
757
1121
|
export class BetaInputMessage extends /*#__PURE__*/S.Struct({
|
|
758
|
-
"
|
|
759
|
-
"
|
|
1122
|
+
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaInputContentBlock)),
|
|
1123
|
+
"role": BetaInputMessageRole
|
|
1124
|
+
}) {}
|
|
1125
|
+
export class BetaRequestMCPServerToolConfiguration extends /*#__PURE__*/S.Struct({
|
|
1126
|
+
"allowed_tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(S.String), S.Null), {
|
|
1127
|
+
nullable: true
|
|
1128
|
+
}),
|
|
1129
|
+
"enabled": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.Boolean, S.Null), {
|
|
1130
|
+
nullable: true
|
|
1131
|
+
})
|
|
1132
|
+
}) {}
|
|
1133
|
+
export class BetaRequestMCPServerURLDefinitionType extends /*#__PURE__*/S.Literal("url") {}
|
|
1134
|
+
export class BetaRequestMCPServerURLDefinition extends /*#__PURE__*/S.Struct({
|
|
1135
|
+
"authorization_token": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
1136
|
+
nullable: true
|
|
1137
|
+
}),
|
|
1138
|
+
"name": S.String,
|
|
1139
|
+
"tool_configuration": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaRequestMCPServerToolConfiguration, S.Null), {
|
|
1140
|
+
nullable: true
|
|
1141
|
+
}),
|
|
1142
|
+
"type": BetaRequestMCPServerURLDefinitionType,
|
|
1143
|
+
"url": S.String
|
|
760
1144
|
}) {}
|
|
761
1145
|
export class BetaMetadata extends /*#__PURE__*/S.Struct({
|
|
762
1146
|
"user_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.maxLength(256)), S.Null), {
|
|
763
1147
|
nullable: true
|
|
764
1148
|
})
|
|
765
1149
|
}) {}
|
|
1150
|
+
export class BetaCreateMessageParamsServiceTier extends /*#__PURE__*/S.Literal("auto", "standard_only") {}
|
|
766
1151
|
export class BetaThinkingConfigEnabledType extends /*#__PURE__*/S.Literal("enabled") {}
|
|
767
1152
|
export class BetaThinkingConfigEnabled extends /*#__PURE__*/S.Struct({
|
|
768
|
-
"
|
|
769
|
-
"
|
|
1153
|
+
"budget_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1024)),
|
|
1154
|
+
"type": BetaThinkingConfigEnabledType
|
|
770
1155
|
}) {}
|
|
771
1156
|
export class BetaThinkingConfigDisabledType extends /*#__PURE__*/S.Literal("disabled") {}
|
|
772
1157
|
export class BetaThinkingConfigDisabled extends /*#__PURE__*/S.Struct({
|
|
@@ -775,25 +1160,25 @@ export class BetaThinkingConfigDisabled extends /*#__PURE__*/S.Struct({
|
|
|
775
1160
|
export class BetaThinkingConfigParam extends /*#__PURE__*/S.Union(BetaThinkingConfigEnabled, BetaThinkingConfigDisabled) {}
|
|
776
1161
|
export class BetaToolChoiceAutoType extends /*#__PURE__*/S.Literal("auto") {}
|
|
777
1162
|
export class BetaToolChoiceAuto extends /*#__PURE__*/S.Struct({
|
|
778
|
-
"type": BetaToolChoiceAutoType,
|
|
779
1163
|
"disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
780
1164
|
nullable: true
|
|
781
|
-
})
|
|
1165
|
+
}),
|
|
1166
|
+
"type": BetaToolChoiceAutoType
|
|
782
1167
|
}) {}
|
|
783
1168
|
export class BetaToolChoiceAnyType extends /*#__PURE__*/S.Literal("any") {}
|
|
784
1169
|
export class BetaToolChoiceAny extends /*#__PURE__*/S.Struct({
|
|
785
|
-
"type": BetaToolChoiceAnyType,
|
|
786
1170
|
"disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
787
1171
|
nullable: true
|
|
788
|
-
})
|
|
1172
|
+
}),
|
|
1173
|
+
"type": BetaToolChoiceAnyType
|
|
789
1174
|
}) {}
|
|
790
1175
|
export class BetaToolChoiceToolType extends /*#__PURE__*/S.Literal("tool") {}
|
|
791
1176
|
export class BetaToolChoiceTool extends /*#__PURE__*/S.Struct({
|
|
792
|
-
"type": BetaToolChoiceToolType,
|
|
793
|
-
"name": S.String,
|
|
794
1177
|
"disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
795
1178
|
nullable: true
|
|
796
|
-
})
|
|
1179
|
+
}),
|
|
1180
|
+
"name": S.String,
|
|
1181
|
+
"type": BetaToolChoiceToolType
|
|
797
1182
|
}) {}
|
|
798
1183
|
export class BetaToolChoiceNoneType extends /*#__PURE__*/S.Literal("none") {}
|
|
799
1184
|
export class BetaToolChoiceNone extends /*#__PURE__*/S.Struct({
|
|
@@ -803,13 +1188,16 @@ export class BetaToolChoice extends /*#__PURE__*/S.Union(BetaToolChoiceAuto, Bet
|
|
|
803
1188
|
export class BetaToolTypeEnum extends /*#__PURE__*/S.Literal("custom") {}
|
|
804
1189
|
export class BetaInputSchemaType extends /*#__PURE__*/S.Literal("object") {}
|
|
805
1190
|
export class BetaInputSchema extends /*#__PURE__*/S.Struct({
|
|
806
|
-
"type": BetaInputSchemaType,
|
|
807
1191
|
"properties": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Record({
|
|
808
1192
|
key: S.String,
|
|
809
1193
|
value: S.Unknown
|
|
810
1194
|
}), S.Null), {
|
|
811
1195
|
nullable: true
|
|
812
|
-
})
|
|
1196
|
+
}),
|
|
1197
|
+
"required": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(S.String), S.Null), {
|
|
1198
|
+
nullable: true
|
|
1199
|
+
}),
|
|
1200
|
+
"type": BetaInputSchemaType
|
|
813
1201
|
}) {}
|
|
814
1202
|
export class BetaTool extends /*#__PURE__*/S.Struct({
|
|
815
1203
|
"type": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.Null, BetaToolTypeEnum), {
|
|
@@ -824,77 +1212,141 @@ export class BetaTool extends /*#__PURE__*/S.Struct({
|
|
|
824
1212
|
nullable: true
|
|
825
1213
|
})
|
|
826
1214
|
}) {}
|
|
827
|
-
export class BetaComputerUseTool20241022Type extends /*#__PURE__*/S.Literal("computer_20241022") {}
|
|
828
1215
|
export class BetaComputerUseTool20241022Name extends /*#__PURE__*/S.Literal("computer") {}
|
|
1216
|
+
export class BetaComputerUseTool20241022Type extends /*#__PURE__*/S.Literal("computer_20241022") {}
|
|
829
1217
|
export class BetaComputerUseTool20241022 extends /*#__PURE__*/S.Struct({
|
|
830
1218
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
831
1219
|
nullable: true
|
|
832
1220
|
}),
|
|
833
|
-
"type": BetaComputerUseTool20241022Type,
|
|
834
|
-
"name": BetaComputerUseTool20241022Name,
|
|
835
1221
|
"display_height_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
836
|
-
"display_width_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
837
1222
|
"display_number": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null), {
|
|
838
1223
|
nullable: true
|
|
839
|
-
})
|
|
1224
|
+
}),
|
|
1225
|
+
"display_width_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1226
|
+
"name": BetaComputerUseTool20241022Name,
|
|
1227
|
+
"type": BetaComputerUseTool20241022Type
|
|
840
1228
|
}) {}
|
|
841
|
-
export class BetaBashTool20241022Type extends /*#__PURE__*/S.Literal("bash_20241022") {}
|
|
842
1229
|
export class BetaBashTool20241022Name extends /*#__PURE__*/S.Literal("bash") {}
|
|
1230
|
+
export class BetaBashTool20241022Type extends /*#__PURE__*/S.Literal("bash_20241022") {}
|
|
843
1231
|
export class BetaBashTool20241022 extends /*#__PURE__*/S.Struct({
|
|
844
1232
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
845
1233
|
nullable: true
|
|
846
1234
|
}),
|
|
847
|
-
"
|
|
848
|
-
"
|
|
1235
|
+
"name": BetaBashTool20241022Name,
|
|
1236
|
+
"type": BetaBashTool20241022Type
|
|
849
1237
|
}) {}
|
|
850
|
-
export class BetaTextEditor20241022Type extends /*#__PURE__*/S.Literal("text_editor_20241022") {}
|
|
851
1238
|
export class BetaTextEditor20241022Name extends /*#__PURE__*/S.Literal("str_replace_editor") {}
|
|
1239
|
+
export class BetaTextEditor20241022Type extends /*#__PURE__*/S.Literal("text_editor_20241022") {}
|
|
852
1240
|
export class BetaTextEditor20241022 extends /*#__PURE__*/S.Struct({
|
|
853
1241
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
854
1242
|
nullable: true
|
|
855
1243
|
}),
|
|
856
|
-
"
|
|
857
|
-
"
|
|
1244
|
+
"name": BetaTextEditor20241022Name,
|
|
1245
|
+
"type": BetaTextEditor20241022Type
|
|
858
1246
|
}) {}
|
|
859
|
-
export class BetaComputerUseTool20250124Type extends /*#__PURE__*/S.Literal("computer_20250124") {}
|
|
860
1247
|
export class BetaComputerUseTool20250124Name extends /*#__PURE__*/S.Literal("computer") {}
|
|
1248
|
+
export class BetaComputerUseTool20250124Type extends /*#__PURE__*/S.Literal("computer_20250124") {}
|
|
861
1249
|
export class BetaComputerUseTool20250124 extends /*#__PURE__*/S.Struct({
|
|
862
1250
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
863
1251
|
nullable: true
|
|
864
1252
|
}),
|
|
865
|
-
"type": BetaComputerUseTool20250124Type,
|
|
866
|
-
"name": BetaComputerUseTool20250124Name,
|
|
867
1253
|
"display_height_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
868
|
-
"display_width_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
869
1254
|
"display_number": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null), {
|
|
870
1255
|
nullable: true
|
|
871
|
-
})
|
|
1256
|
+
}),
|
|
1257
|
+
"display_width_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1258
|
+
"name": BetaComputerUseTool20250124Name,
|
|
1259
|
+
"type": BetaComputerUseTool20250124Type
|
|
872
1260
|
}) {}
|
|
873
|
-
export class BetaBashTool20250124Type extends /*#__PURE__*/S.Literal("bash_20250124") {}
|
|
874
1261
|
export class BetaBashTool20250124Name extends /*#__PURE__*/S.Literal("bash") {}
|
|
1262
|
+
export class BetaBashTool20250124Type extends /*#__PURE__*/S.Literal("bash_20250124") {}
|
|
875
1263
|
export class BetaBashTool20250124 extends /*#__PURE__*/S.Struct({
|
|
876
1264
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
877
1265
|
nullable: true
|
|
878
1266
|
}),
|
|
879
|
-
"
|
|
880
|
-
"
|
|
1267
|
+
"name": BetaBashTool20250124Name,
|
|
1268
|
+
"type": BetaBashTool20250124Type
|
|
881
1269
|
}) {}
|
|
882
|
-
export class BetaTextEditor20250124Type extends /*#__PURE__*/S.Literal("text_editor_20250124") {}
|
|
883
1270
|
export class BetaTextEditor20250124Name extends /*#__PURE__*/S.Literal("str_replace_editor") {}
|
|
1271
|
+
export class BetaTextEditor20250124Type extends /*#__PURE__*/S.Literal("text_editor_20250124") {}
|
|
884
1272
|
export class BetaTextEditor20250124 extends /*#__PURE__*/S.Struct({
|
|
885
1273
|
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
886
1274
|
nullable: true
|
|
887
1275
|
}),
|
|
888
|
-
"
|
|
889
|
-
"
|
|
1276
|
+
"name": BetaTextEditor20250124Name,
|
|
1277
|
+
"type": BetaTextEditor20250124Type
|
|
1278
|
+
}) {}
|
|
1279
|
+
export class BetaTextEditor20250429Name extends /*#__PURE__*/S.Literal("str_replace_based_edit_tool") {}
|
|
1280
|
+
export class BetaTextEditor20250429Type extends /*#__PURE__*/S.Literal("text_editor_20250429") {}
|
|
1281
|
+
export class BetaTextEditor20250429 extends /*#__PURE__*/S.Struct({
|
|
1282
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1283
|
+
nullable: true
|
|
1284
|
+
}),
|
|
1285
|
+
"name": BetaTextEditor20250429Name,
|
|
1286
|
+
"type": BetaTextEditor20250429Type
|
|
1287
|
+
}) {}
|
|
1288
|
+
export class BetaWebSearchTool20250305Name extends /*#__PURE__*/S.Literal("web_search") {}
|
|
1289
|
+
export class BetaWebSearchTool20250305Type extends /*#__PURE__*/S.Literal("web_search_20250305") {}
|
|
1290
|
+
export class BetaUserLocationType extends /*#__PURE__*/S.Literal("approximate") {}
|
|
1291
|
+
export class BetaUserLocation extends /*#__PURE__*/S.Struct({
|
|
1292
|
+
"city": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
|
|
1293
|
+
nullable: true
|
|
1294
|
+
}),
|
|
1295
|
+
"country": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(2), /*#__PURE__*/S.maxLength(2)), S.Null), {
|
|
1296
|
+
nullable: true
|
|
1297
|
+
}),
|
|
1298
|
+
"region": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
|
|
1299
|
+
nullable: true
|
|
1300
|
+
}),
|
|
1301
|
+
"timezone": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
|
|
1302
|
+
nullable: true
|
|
1303
|
+
}),
|
|
1304
|
+
"type": BetaUserLocationType
|
|
1305
|
+
}) {}
|
|
1306
|
+
export class BetaWebSearchTool20250305 extends /*#__PURE__*/S.Struct({
|
|
1307
|
+
"allowed_domains": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(S.String), S.Null), {
|
|
1308
|
+
nullable: true
|
|
1309
|
+
}),
|
|
1310
|
+
"blocked_domains": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(S.String), S.Null), {
|
|
1311
|
+
nullable: true
|
|
1312
|
+
}),
|
|
1313
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1314
|
+
nullable: true
|
|
1315
|
+
}),
|
|
1316
|
+
"max_uses": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThan(0)), S.Null), {
|
|
1317
|
+
nullable: true
|
|
1318
|
+
}),
|
|
1319
|
+
"name": BetaWebSearchTool20250305Name,
|
|
1320
|
+
"type": BetaWebSearchTool20250305Type,
|
|
1321
|
+
"user_location": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaUserLocation, S.Null), {
|
|
1322
|
+
nullable: true
|
|
1323
|
+
})
|
|
1324
|
+
}) {}
|
|
1325
|
+
export class BetaCodeExecutionTool20250522Name extends /*#__PURE__*/S.Literal("code_execution") {}
|
|
1326
|
+
export class BetaCodeExecutionTool20250522Type extends /*#__PURE__*/S.Literal("code_execution_20250522") {}
|
|
1327
|
+
export class BetaCodeExecutionTool20250522 extends /*#__PURE__*/S.Struct({
|
|
1328
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1329
|
+
nullable: true
|
|
1330
|
+
}),
|
|
1331
|
+
"name": BetaCodeExecutionTool20250522Name,
|
|
1332
|
+
"type": BetaCodeExecutionTool20250522Type
|
|
890
1333
|
}) {}
|
|
891
1334
|
export class BetaCreateMessageParams extends /*#__PURE__*/S.Class("BetaCreateMessageParams")({
|
|
892
|
-
"model": Model,
|
|
1335
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
893
1336
|
"messages": /*#__PURE__*/S.Array(BetaInputMessage),
|
|
1337
|
+
"container": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
1338
|
+
nullable: true
|
|
1339
|
+
}),
|
|
894
1340
|
"max_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1341
|
+
"mcp_servers": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(BetaRequestMCPServerURLDefinition).pipe(/*#__PURE__*/S.maxItems(20)), {
|
|
1342
|
+
nullable: true
|
|
1343
|
+
}),
|
|
895
1344
|
"metadata": /*#__PURE__*/S.optionalWith(BetaMetadata, {
|
|
896
1345
|
nullable: true
|
|
897
1346
|
}),
|
|
1347
|
+
"service_tier": /*#__PURE__*/S.optionalWith(BetaCreateMessageParamsServiceTier, {
|
|
1348
|
+
nullable: true
|
|
1349
|
+
}),
|
|
898
1350
|
"stop_sequences": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(S.String), {
|
|
899
1351
|
nullable: true
|
|
900
1352
|
}),
|
|
@@ -913,7 +1365,7 @@ export class BetaCreateMessageParams extends /*#__PURE__*/S.Class("BetaCreateMes
|
|
|
913
1365
|
"tool_choice": /*#__PURE__*/S.optionalWith(BetaToolChoice, {
|
|
914
1366
|
nullable: true
|
|
915
1367
|
}),
|
|
916
|
-
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022, BetaComputerUseTool20250124, BetaBashTool20250124, BetaTextEditor20250124)), {
|
|
1368
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022, BetaComputerUseTool20250124, BetaBashTool20250124, BetaTextEditor20250124, BetaTextEditor20250429, BetaWebSearchTool20250305, BetaCodeExecutionTool20250522)), {
|
|
917
1369
|
nullable: true
|
|
918
1370
|
}),
|
|
919
1371
|
"top_k": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), {
|
|
@@ -925,135 +1377,228 @@ export class BetaCreateMessageParams extends /*#__PURE__*/S.Class("BetaCreateMes
|
|
|
925
1377
|
}) {}
|
|
926
1378
|
export class BetaMessageType extends /*#__PURE__*/S.Literal("message") {}
|
|
927
1379
|
export class BetaMessageRole extends /*#__PURE__*/S.Literal("assistant") {}
|
|
928
|
-
export class BetaResponseTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
929
1380
|
export class BetaResponseCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
|
|
930
1381
|
export class BetaResponseCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
931
|
-
"type": /*#__PURE__*/BetaResponseCharLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "char_location")),
|
|
932
1382
|
"cited_text": S.String,
|
|
933
1383
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
934
1384
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1385
|
+
"end_char_index": S.Int,
|
|
935
1386
|
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
936
|
-
"
|
|
1387
|
+
"type": BetaResponseCharLocationCitationType
|
|
937
1388
|
}) {}
|
|
938
1389
|
export class BetaResponsePageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
|
|
939
1390
|
export class BetaResponsePageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
940
|
-
"type": /*#__PURE__*/BetaResponsePageLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "page_location")),
|
|
941
1391
|
"cited_text": S.String,
|
|
942
1392
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
943
1393
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1394
|
+
"end_page_number": S.Int,
|
|
944
1395
|
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
945
|
-
"
|
|
1396
|
+
"type": BetaResponsePageLocationCitationType
|
|
946
1397
|
}) {}
|
|
947
1398
|
export class BetaResponseContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
|
|
948
1399
|
export class BetaResponseContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
949
|
-
"type": /*#__PURE__*/BetaResponseContentBlockLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "content_block_location")),
|
|
950
1400
|
"cited_text": S.String,
|
|
951
1401
|
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
952
1402
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1403
|
+
"end_block_index": S.Int,
|
|
953
1404
|
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
954
|
-
"
|
|
1405
|
+
"type": BetaResponseContentBlockLocationCitationType
|
|
1406
|
+
}) {}
|
|
1407
|
+
export class BetaResponseWebSearchResultLocationCitationType extends /*#__PURE__*/S.Literal("web_search_result_location") {}
|
|
1408
|
+
export class BetaResponseWebSearchResultLocationCitation extends /*#__PURE__*/S.Struct({
|
|
1409
|
+
"cited_text": S.String,
|
|
1410
|
+
"encrypted_index": S.String,
|
|
1411
|
+
"title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1412
|
+
"type": BetaResponseWebSearchResultLocationCitationType,
|
|
1413
|
+
"url": S.String
|
|
955
1414
|
}) {}
|
|
1415
|
+
export class BetaResponseTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
956
1416
|
export class BetaResponseTextBlock extends /*#__PURE__*/S.Struct({
|
|
957
|
-
"
|
|
1417
|
+
"citations": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaResponseCharLocationCitation, BetaResponsePageLocationCitation, BetaResponseContentBlockLocationCitation, BetaResponseWebSearchResultLocationCitation)), S.Null)),
|
|
958
1418
|
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(0), /*#__PURE__*/S.maxLength(5000000)),
|
|
959
|
-
"
|
|
960
|
-
default: () => null
|
|
961
|
-
})
|
|
1419
|
+
"type": BetaResponseTextBlockType
|
|
962
1420
|
}) {}
|
|
963
1421
|
export class BetaResponseToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
964
1422
|
export class BetaResponseToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
965
|
-
"type": /*#__PURE__*/BetaResponseToolUseBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "tool_use")),
|
|
966
1423
|
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
1424
|
+
"input": /*#__PURE__*/S.Record({
|
|
1425
|
+
key: S.String,
|
|
1426
|
+
value: S.Unknown
|
|
1427
|
+
}),
|
|
967
1428
|
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
1429
|
+
"type": BetaResponseToolUseBlockType
|
|
1430
|
+
}) {}
|
|
1431
|
+
export class BetaResponseServerToolUseBlockName extends /*#__PURE__*/S.Literal("web_search", "code_execution") {}
|
|
1432
|
+
export class BetaResponseServerToolUseBlockType extends /*#__PURE__*/S.Literal("server_tool_use") {}
|
|
1433
|
+
export class BetaResponseServerToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
1434
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
968
1435
|
"input": /*#__PURE__*/S.Record({
|
|
969
1436
|
key: S.String,
|
|
970
1437
|
value: S.Unknown
|
|
971
|
-
})
|
|
1438
|
+
}),
|
|
1439
|
+
"name": BetaResponseServerToolUseBlockName,
|
|
1440
|
+
"type": BetaResponseServerToolUseBlockType
|
|
1441
|
+
}) {}
|
|
1442
|
+
export class BetaResponseWebSearchToolResultErrorType extends /*#__PURE__*/S.Literal("web_search_tool_result_error") {}
|
|
1443
|
+
export class BetaResponseWebSearchToolResultError extends /*#__PURE__*/S.Struct({
|
|
1444
|
+
"error_code": BetaWebSearchToolResultErrorCode,
|
|
1445
|
+
"type": BetaResponseWebSearchToolResultErrorType
|
|
1446
|
+
}) {}
|
|
1447
|
+
export class BetaResponseWebSearchResultBlockType extends /*#__PURE__*/S.Literal("web_search_result") {}
|
|
1448
|
+
export class BetaResponseWebSearchResultBlock extends /*#__PURE__*/S.Struct({
|
|
1449
|
+
"encrypted_content": S.String,
|
|
1450
|
+
"page_age": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(S.String, S.Null)),
|
|
1451
|
+
"title": S.String,
|
|
1452
|
+
"type": BetaResponseWebSearchResultBlockType,
|
|
1453
|
+
"url": S.String
|
|
1454
|
+
}) {}
|
|
1455
|
+
export class BetaResponseWebSearchToolResultBlockType extends /*#__PURE__*/S.Literal("web_search_tool_result") {}
|
|
1456
|
+
export class BetaResponseWebSearchToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
1457
|
+
"content": /*#__PURE__*/S.Union(BetaResponseWebSearchToolResultError, /*#__PURE__*/S.Array(BetaResponseWebSearchResultBlock)),
|
|
1458
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
1459
|
+
"type": BetaResponseWebSearchToolResultBlockType
|
|
1460
|
+
}) {}
|
|
1461
|
+
export class BetaResponseCodeExecutionToolResultErrorType extends /*#__PURE__*/S.Literal("code_execution_tool_result_error") {}
|
|
1462
|
+
export class BetaResponseCodeExecutionToolResultError extends /*#__PURE__*/S.Struct({
|
|
1463
|
+
"error_code": BetaCodeExecutionToolResultErrorCode,
|
|
1464
|
+
"type": BetaResponseCodeExecutionToolResultErrorType
|
|
1465
|
+
}) {}
|
|
1466
|
+
export class BetaResponseCodeExecutionOutputBlockType extends /*#__PURE__*/S.Literal("code_execution_output") {}
|
|
1467
|
+
export class BetaResponseCodeExecutionOutputBlock extends /*#__PURE__*/S.Struct({
|
|
1468
|
+
"file_id": S.String,
|
|
1469
|
+
"type": BetaResponseCodeExecutionOutputBlockType
|
|
1470
|
+
}) {}
|
|
1471
|
+
export class BetaResponseCodeExecutionResultBlockType extends /*#__PURE__*/S.Literal("code_execution_result") {}
|
|
1472
|
+
export class BetaResponseCodeExecutionResultBlock extends /*#__PURE__*/S.Struct({
|
|
1473
|
+
"content": /*#__PURE__*/S.Array(BetaResponseCodeExecutionOutputBlock),
|
|
1474
|
+
"return_code": S.Int,
|
|
1475
|
+
"stderr": S.String,
|
|
1476
|
+
"stdout": S.String,
|
|
1477
|
+
"type": BetaResponseCodeExecutionResultBlockType
|
|
1478
|
+
}) {}
|
|
1479
|
+
export class BetaResponseCodeExecutionToolResultBlockType extends /*#__PURE__*/S.Literal("code_execution_tool_result") {}
|
|
1480
|
+
export class BetaResponseCodeExecutionToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
1481
|
+
"content": /*#__PURE__*/S.Union(BetaResponseCodeExecutionToolResultError, BetaResponseCodeExecutionResultBlock),
|
|
1482
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^srvtoolu_[a-zA-Z0-9_]+$"))),
|
|
1483
|
+
"type": BetaResponseCodeExecutionToolResultBlockType
|
|
1484
|
+
}) {}
|
|
1485
|
+
export class BetaResponseMCPToolUseBlockType extends /*#__PURE__*/S.Literal("mcp_tool_use") {}
|
|
1486
|
+
export class BetaResponseMCPToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
1487
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
1488
|
+
"input": /*#__PURE__*/S.Record({
|
|
1489
|
+
key: S.String,
|
|
1490
|
+
value: S.Unknown
|
|
1491
|
+
}),
|
|
1492
|
+
"name": S.String,
|
|
1493
|
+
"server_name": S.String,
|
|
1494
|
+
"type": BetaResponseMCPToolUseBlockType
|
|
1495
|
+
}) {}
|
|
1496
|
+
export class BetaResponseMCPToolResultBlockType extends /*#__PURE__*/S.Literal("mcp_tool_result") {}
|
|
1497
|
+
export class BetaResponseMCPToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
1498
|
+
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaResponseTextBlock)),
|
|
1499
|
+
"is_error": S.Boolean,
|
|
1500
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
1501
|
+
"type": BetaResponseMCPToolResultBlockType
|
|
1502
|
+
}) {}
|
|
1503
|
+
export class BetaResponseContainerUploadBlockType extends /*#__PURE__*/S.Literal("container_upload") {}
|
|
1504
|
+
export class BetaResponseContainerUploadBlock extends /*#__PURE__*/S.Struct({
|
|
1505
|
+
"file_id": S.String,
|
|
1506
|
+
"type": BetaResponseContainerUploadBlockType
|
|
972
1507
|
}) {}
|
|
973
1508
|
export class BetaResponseThinkingBlockType extends /*#__PURE__*/S.Literal("thinking") {}
|
|
974
1509
|
export class BetaResponseThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
975
|
-
"
|
|
1510
|
+
"signature": S.String,
|
|
976
1511
|
"thinking": S.String,
|
|
977
|
-
"
|
|
1512
|
+
"type": BetaResponseThinkingBlockType
|
|
978
1513
|
}) {}
|
|
979
1514
|
export class BetaResponseRedactedThinkingBlockType extends /*#__PURE__*/S.Literal("redacted_thinking") {}
|
|
980
1515
|
export class BetaResponseRedactedThinkingBlock extends /*#__PURE__*/S.Struct({
|
|
981
|
-
"
|
|
982
|
-
"
|
|
1516
|
+
"data": S.String,
|
|
1517
|
+
"type": BetaResponseRedactedThinkingBlockType
|
|
1518
|
+
}) {}
|
|
1519
|
+
export class BetaContentBlock extends /*#__PURE__*/S.Union(BetaResponseTextBlock, BetaResponseToolUseBlock, BetaResponseServerToolUseBlock, BetaResponseWebSearchToolResultBlock, BetaResponseCodeExecutionToolResultBlock, BetaResponseMCPToolUseBlock, BetaResponseMCPToolResultBlock, BetaResponseContainerUploadBlock, BetaResponseThinkingBlock, BetaResponseRedactedThinkingBlock) {}
|
|
1520
|
+
export class BetaStopReason extends /*#__PURE__*/S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use", "pause_turn", "refusal") {}
|
|
1521
|
+
export class BetaCacheCreation extends /*#__PURE__*/S.Struct({
|
|
1522
|
+
"ephemeral_1h_input_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1523
|
+
"ephemeral_5m_input_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0))
|
|
1524
|
+
}) {}
|
|
1525
|
+
export class BetaServerToolUsage extends /*#__PURE__*/S.Struct({
|
|
1526
|
+
"web_search_requests": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0))
|
|
983
1527
|
}) {}
|
|
984
|
-
export class
|
|
985
|
-
export class BetaMessageStopReasonEnum extends /*#__PURE__*/S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use") {}
|
|
1528
|
+
export class BetaUsageServiceTierEnum extends /*#__PURE__*/S.Literal("standard", "priority", "batch") {}
|
|
986
1529
|
export class BetaUsage extends /*#__PURE__*/S.Struct({
|
|
1530
|
+
"cache_creation": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(BetaCacheCreation, S.Null)),
|
|
1531
|
+
"cache_creation_input_tokens": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)),
|
|
1532
|
+
"cache_read_input_tokens": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)),
|
|
987
1533
|
"input_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
988
|
-
"
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
"
|
|
1534
|
+
"output_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1535
|
+
"server_tool_use": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(BetaServerToolUsage, S.Null)),
|
|
1536
|
+
"service_tier": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(BetaUsageServiceTierEnum, S.Null))
|
|
1537
|
+
}) {}
|
|
1538
|
+
export class BetaContainer extends /*#__PURE__*/S.Struct({
|
|
1539
|
+
"expires_at": S.String,
|
|
1540
|
+
"id": S.String
|
|
995
1541
|
}) {}
|
|
996
1542
|
export class BetaMessage extends /*#__PURE__*/S.Class("BetaMessage")({
|
|
997
1543
|
"id": S.String,
|
|
998
|
-
"type":
|
|
999
|
-
"role":
|
|
1544
|
+
"type": BetaMessageType,
|
|
1545
|
+
"role": BetaMessageRole,
|
|
1000
1546
|
"content": /*#__PURE__*/S.Array(BetaContentBlock),
|
|
1001
|
-
"model": Model,
|
|
1002
|
-
"stop_reason": /*#__PURE__*/S.Union(
|
|
1003
|
-
"stop_sequence": /*#__PURE__*/S.
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
"usage": BetaUsage
|
|
1547
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
1548
|
+
"stop_reason": /*#__PURE__*/S.Union(BetaStopReason, S.Null),
|
|
1549
|
+
"stop_sequence": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(S.String, S.Null)),
|
|
1550
|
+
"usage": BetaUsage,
|
|
1551
|
+
"container": /*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(BetaContainer, S.Null))
|
|
1007
1552
|
}) {}
|
|
1008
|
-
export class BetaErrorResponseType extends /*#__PURE__*/S.Literal("error") {}
|
|
1009
1553
|
export class BetaInvalidRequestErrorType extends /*#__PURE__*/S.Literal("invalid_request_error") {}
|
|
1010
1554
|
export class BetaInvalidRequestError extends /*#__PURE__*/S.Struct({
|
|
1011
|
-
"
|
|
1012
|
-
"
|
|
1555
|
+
"message": S.String,
|
|
1556
|
+
"type": BetaInvalidRequestErrorType
|
|
1013
1557
|
}) {}
|
|
1014
1558
|
export class BetaAuthenticationErrorType extends /*#__PURE__*/S.Literal("authentication_error") {}
|
|
1015
1559
|
export class BetaAuthenticationError extends /*#__PURE__*/S.Struct({
|
|
1016
|
-
"
|
|
1017
|
-
"
|
|
1560
|
+
"message": S.String,
|
|
1561
|
+
"type": BetaAuthenticationErrorType
|
|
1018
1562
|
}) {}
|
|
1019
1563
|
export class BetaBillingErrorType extends /*#__PURE__*/S.Literal("billing_error") {}
|
|
1020
1564
|
export class BetaBillingError extends /*#__PURE__*/S.Struct({
|
|
1021
|
-
"
|
|
1022
|
-
"
|
|
1565
|
+
"message": S.String,
|
|
1566
|
+
"type": BetaBillingErrorType
|
|
1023
1567
|
}) {}
|
|
1024
1568
|
export class BetaPermissionErrorType extends /*#__PURE__*/S.Literal("permission_error") {}
|
|
1025
1569
|
export class BetaPermissionError extends /*#__PURE__*/S.Struct({
|
|
1026
|
-
"
|
|
1027
|
-
"
|
|
1570
|
+
"message": S.String,
|
|
1571
|
+
"type": BetaPermissionErrorType
|
|
1028
1572
|
}) {}
|
|
1029
1573
|
export class BetaNotFoundErrorType extends /*#__PURE__*/S.Literal("not_found_error") {}
|
|
1030
1574
|
export class BetaNotFoundError extends /*#__PURE__*/S.Struct({
|
|
1031
|
-
"
|
|
1032
|
-
"
|
|
1575
|
+
"message": S.String,
|
|
1576
|
+
"type": BetaNotFoundErrorType
|
|
1033
1577
|
}) {}
|
|
1034
1578
|
export class BetaRateLimitErrorType extends /*#__PURE__*/S.Literal("rate_limit_error") {}
|
|
1035
1579
|
export class BetaRateLimitError extends /*#__PURE__*/S.Struct({
|
|
1036
|
-
"
|
|
1037
|
-
"
|
|
1580
|
+
"message": S.String,
|
|
1581
|
+
"type": BetaRateLimitErrorType
|
|
1038
1582
|
}) {}
|
|
1039
1583
|
export class BetaGatewayTimeoutErrorType extends /*#__PURE__*/S.Literal("timeout_error") {}
|
|
1040
1584
|
export class BetaGatewayTimeoutError extends /*#__PURE__*/S.Struct({
|
|
1041
|
-
"
|
|
1042
|
-
"
|
|
1585
|
+
"message": S.String,
|
|
1586
|
+
"type": BetaGatewayTimeoutErrorType
|
|
1043
1587
|
}) {}
|
|
1044
1588
|
export class BetaAPIErrorType extends /*#__PURE__*/S.Literal("api_error") {}
|
|
1045
1589
|
export class BetaAPIError extends /*#__PURE__*/S.Struct({
|
|
1046
|
-
"
|
|
1047
|
-
"
|
|
1590
|
+
"message": S.String,
|
|
1591
|
+
"type": BetaAPIErrorType
|
|
1048
1592
|
}) {}
|
|
1049
1593
|
export class BetaOverloadedErrorType extends /*#__PURE__*/S.Literal("overloaded_error") {}
|
|
1050
1594
|
export class BetaOverloadedError extends /*#__PURE__*/S.Struct({
|
|
1051
|
-
"
|
|
1052
|
-
"
|
|
1595
|
+
"message": S.String,
|
|
1596
|
+
"type": BetaOverloadedErrorType
|
|
1053
1597
|
}) {}
|
|
1598
|
+
export class BetaErrorResponseType extends /*#__PURE__*/S.Literal("error") {}
|
|
1054
1599
|
export class BetaErrorResponse extends /*#__PURE__*/S.Class("BetaErrorResponse")({
|
|
1055
|
-
"
|
|
1056
|
-
"
|
|
1600
|
+
"error": /*#__PURE__*/S.Union(BetaInvalidRequestError, BetaAuthenticationError, BetaBillingError, BetaPermissionError, BetaNotFoundError, BetaRateLimitError, BetaGatewayTimeoutError, BetaAPIError, BetaOverloadedError),
|
|
1601
|
+
"type": BetaErrorResponseType
|
|
1057
1602
|
}) {}
|
|
1058
1603
|
export class BetaModelsListParams extends /*#__PURE__*/S.Struct({
|
|
1059
1604
|
"before_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
@@ -1063,27 +1608,29 @@ export class BetaModelsListParams extends /*#__PURE__*/S.Struct({
|
|
|
1063
1608
|
nullable: true
|
|
1064
1609
|
}),
|
|
1065
1610
|
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
1066
|
-
nullable: true
|
|
1067
|
-
default: () => 20
|
|
1611
|
+
nullable: true
|
|
1068
1612
|
}),
|
|
1069
1613
|
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1070
1614
|
nullable: true
|
|
1071
1615
|
}),
|
|
1072
1616
|
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1073
1617
|
nullable: true
|
|
1618
|
+
}),
|
|
1619
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1620
|
+
nullable: true
|
|
1074
1621
|
})
|
|
1075
1622
|
}) {}
|
|
1076
1623
|
export class BetaModelInfoType extends /*#__PURE__*/S.Literal("model") {}
|
|
1077
1624
|
export class BetaModelInfo extends /*#__PURE__*/S.Struct({
|
|
1078
|
-
"
|
|
1079
|
-
"id": S.String,
|
|
1625
|
+
"created_at": S.String,
|
|
1080
1626
|
"display_name": S.String,
|
|
1081
|
-
"
|
|
1627
|
+
"id": S.String,
|
|
1628
|
+
"type": BetaModelInfoType
|
|
1082
1629
|
}) {}
|
|
1083
1630
|
export class BetaListResponseModelInfo extends /*#__PURE__*/S.Class("BetaListResponseModelInfo")({
|
|
1084
1631
|
"data": /*#__PURE__*/S.Array(BetaModelInfo),
|
|
1085
|
-
"has_more": S.Boolean,
|
|
1086
1632
|
"first_id": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1633
|
+
"has_more": S.Boolean,
|
|
1087
1634
|
"last_id": /*#__PURE__*/S.Union(S.String, S.Null)
|
|
1088
1635
|
}) {}
|
|
1089
1636
|
export class BetaModelsGetParams extends /*#__PURE__*/S.Struct({
|
|
@@ -1092,6 +1639,9 @@ export class BetaModelsGetParams extends /*#__PURE__*/S.Struct({
|
|
|
1092
1639
|
}),
|
|
1093
1640
|
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1094
1641
|
nullable: true
|
|
1642
|
+
}),
|
|
1643
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1644
|
+
nullable: true
|
|
1095
1645
|
})
|
|
1096
1646
|
}) {}
|
|
1097
1647
|
export class BetaMessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
@@ -1102,8 +1652,7 @@ export class BetaMessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
|
1102
1652
|
nullable: true
|
|
1103
1653
|
}),
|
|
1104
1654
|
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
1105
|
-
nullable: true
|
|
1106
|
-
default: () => 20
|
|
1655
|
+
nullable: true
|
|
1107
1656
|
}),
|
|
1108
1657
|
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1109
1658
|
nullable: true
|
|
@@ -1115,31 +1664,31 @@ export class BetaMessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
|
1115
1664
|
nullable: true
|
|
1116
1665
|
})
|
|
1117
1666
|
}) {}
|
|
1118
|
-
export class BetaMessageBatchType extends /*#__PURE__*/S.Literal("message_batch") {}
|
|
1119
1667
|
export class BetaMessageBatchProcessingStatus extends /*#__PURE__*/S.Literal("in_progress", "canceling", "ended") {}
|
|
1120
1668
|
export class BetaRequestCounts extends /*#__PURE__*/S.Struct({
|
|
1121
|
-
"
|
|
1122
|
-
"
|
|
1123
|
-
"
|
|
1124
|
-
"
|
|
1125
|
-
"
|
|
1669
|
+
"canceled": S.Int,
|
|
1670
|
+
"errored": S.Int,
|
|
1671
|
+
"expired": S.Int,
|
|
1672
|
+
"processing": S.Int,
|
|
1673
|
+
"succeeded": S.Int
|
|
1126
1674
|
}) {}
|
|
1675
|
+
export class BetaMessageBatchType extends /*#__PURE__*/S.Literal("message_batch") {}
|
|
1127
1676
|
export class BetaMessageBatch extends /*#__PURE__*/S.Struct({
|
|
1677
|
+
"archived_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1678
|
+
"cancel_initiated_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1679
|
+
"created_at": S.String,
|
|
1680
|
+
"ended_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1681
|
+
"expires_at": S.String,
|
|
1128
1682
|
"id": S.String,
|
|
1129
|
-
"type": /*#__PURE__*/BetaMessageBatchType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message_batch")),
|
|
1130
1683
|
"processing_status": BetaMessageBatchProcessingStatus,
|
|
1131
1684
|
"request_counts": BetaRequestCounts,
|
|
1132
|
-
"
|
|
1133
|
-
"
|
|
1134
|
-
"expires_at": S.String,
|
|
1135
|
-
"archived_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1136
|
-
"cancel_initiated_at": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1137
|
-
"results_url": /*#__PURE__*/S.Union(S.String, S.Null)
|
|
1685
|
+
"results_url": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1686
|
+
"type": BetaMessageBatchType
|
|
1138
1687
|
}) {}
|
|
1139
1688
|
export class BetaListResponseMessageBatch extends /*#__PURE__*/S.Class("BetaListResponseMessageBatch")({
|
|
1140
1689
|
"data": /*#__PURE__*/S.Array(BetaMessageBatch),
|
|
1141
|
-
"has_more": S.Boolean,
|
|
1142
1690
|
"first_id": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1691
|
+
"has_more": S.Boolean,
|
|
1143
1692
|
"last_id": /*#__PURE__*/S.Union(S.String, S.Null)
|
|
1144
1693
|
}) {}
|
|
1145
1694
|
export class BetaMessageBatchesPostParams extends /*#__PURE__*/S.Struct({
|
|
@@ -1182,7 +1731,7 @@ export class BetaMessageBatchesDeleteParams extends /*#__PURE__*/S.Struct({
|
|
|
1182
1731
|
export class BetaDeleteMessageBatchResponseType extends /*#__PURE__*/S.Literal("message_batch_deleted") {}
|
|
1183
1732
|
export class BetaDeleteMessageBatchResponse extends /*#__PURE__*/S.Class("BetaDeleteMessageBatchResponse")({
|
|
1184
1733
|
"id": S.String,
|
|
1185
|
-
"type":
|
|
1734
|
+
"type": BetaDeleteMessageBatchResponseType
|
|
1186
1735
|
}) {}
|
|
1187
1736
|
export class BetaMessageBatchesCancelParams extends /*#__PURE__*/S.Struct({
|
|
1188
1737
|
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
@@ -1212,24 +1761,119 @@ export class BetaMessagesCountTokensPostParams extends /*#__PURE__*/S.Struct({
|
|
|
1212
1761
|
})
|
|
1213
1762
|
}) {}
|
|
1214
1763
|
export class BetaCountMessageTokensParams extends /*#__PURE__*/S.Class("BetaCountMessageTokensParams")({
|
|
1215
|
-
"
|
|
1216
|
-
nullable: true
|
|
1217
|
-
}),
|
|
1218
|
-
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022, BetaComputerUseTool20250124, BetaBashTool20250124, BetaTextEditor20250124)), {
|
|
1764
|
+
"mcp_servers": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(BetaRequestMCPServerURLDefinition).pipe(/*#__PURE__*/S.maxItems(20)), {
|
|
1219
1765
|
nullable: true
|
|
1220
1766
|
}),
|
|
1221
1767
|
"messages": /*#__PURE__*/S.Array(BetaInputMessage),
|
|
1768
|
+
"model": /*#__PURE__*/S.Union(S.String, Model),
|
|
1222
1769
|
"system": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaRequestTextBlock)), {
|
|
1223
1770
|
nullable: true
|
|
1224
1771
|
}),
|
|
1225
1772
|
"thinking": /*#__PURE__*/S.optionalWith(BetaThinkingConfigParam, {
|
|
1226
1773
|
nullable: true
|
|
1227
1774
|
}),
|
|
1228
|
-
"
|
|
1775
|
+
"tool_choice": /*#__PURE__*/S.optionalWith(BetaToolChoice, {
|
|
1776
|
+
nullable: true
|
|
1777
|
+
}),
|
|
1778
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022, BetaComputerUseTool20250124, BetaBashTool20250124, BetaTextEditor20250124, BetaTextEditor20250429, BetaWebSearchTool20250305, BetaCodeExecutionTool20250522)), {
|
|
1779
|
+
nullable: true
|
|
1780
|
+
})
|
|
1229
1781
|
}) {}
|
|
1230
1782
|
export class BetaCountMessageTokensResponse extends /*#__PURE__*/S.Class("BetaCountMessageTokensResponse")({
|
|
1231
1783
|
"input_tokens": S.Int
|
|
1232
1784
|
}) {}
|
|
1785
|
+
export class BetaListFilesV1FilesGetParams extends /*#__PURE__*/S.Struct({
|
|
1786
|
+
"before_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1787
|
+
nullable: true
|
|
1788
|
+
}),
|
|
1789
|
+
"after_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1790
|
+
nullable: true
|
|
1791
|
+
}),
|
|
1792
|
+
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
1793
|
+
nullable: true
|
|
1794
|
+
}),
|
|
1795
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1796
|
+
nullable: true
|
|
1797
|
+
}),
|
|
1798
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1799
|
+
nullable: true
|
|
1800
|
+
}),
|
|
1801
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1802
|
+
nullable: true
|
|
1803
|
+
})
|
|
1804
|
+
}) {}
|
|
1805
|
+
export class BetaFileMetadataSchemaType extends /*#__PURE__*/S.Literal("file") {}
|
|
1806
|
+
export class BetaFileMetadataSchema extends /*#__PURE__*/S.Struct({
|
|
1807
|
+
"created_at": S.String,
|
|
1808
|
+
"downloadable": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
1809
|
+
nullable: true
|
|
1810
|
+
}),
|
|
1811
|
+
"filename": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)),
|
|
1812
|
+
"id": S.String,
|
|
1813
|
+
"mime_type": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)),
|
|
1814
|
+
"size_bytes": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1815
|
+
"type": BetaFileMetadataSchemaType
|
|
1816
|
+
}) {}
|
|
1817
|
+
export class BetaFileListResponse extends /*#__PURE__*/S.Class("BetaFileListResponse")({
|
|
1818
|
+
"data": /*#__PURE__*/S.Array(BetaFileMetadataSchema),
|
|
1819
|
+
"first_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
1820
|
+
nullable: true
|
|
1821
|
+
}),
|
|
1822
|
+
"has_more": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
1823
|
+
nullable: true
|
|
1824
|
+
}),
|
|
1825
|
+
"last_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, S.Null), {
|
|
1826
|
+
nullable: true
|
|
1827
|
+
})
|
|
1828
|
+
}) {}
|
|
1829
|
+
export class BetaUploadFileV1FilesPostParams extends /*#__PURE__*/S.Struct({
|
|
1830
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1831
|
+
nullable: true
|
|
1832
|
+
}),
|
|
1833
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1834
|
+
nullable: true
|
|
1835
|
+
})
|
|
1836
|
+
}) {}
|
|
1837
|
+
export class BetaGetFileMetadataV1FilesFileIdGetParams extends /*#__PURE__*/S.Struct({
|
|
1838
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1839
|
+
nullable: true
|
|
1840
|
+
}),
|
|
1841
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1842
|
+
nullable: true
|
|
1843
|
+
}),
|
|
1844
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1845
|
+
nullable: true
|
|
1846
|
+
})
|
|
1847
|
+
}) {}
|
|
1848
|
+
export class BetaDeleteFileV1FilesFileIdDeleteParams extends /*#__PURE__*/S.Struct({
|
|
1849
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1850
|
+
nullable: true
|
|
1851
|
+
}),
|
|
1852
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1853
|
+
nullable: true
|
|
1854
|
+
}),
|
|
1855
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1856
|
+
nullable: true
|
|
1857
|
+
})
|
|
1858
|
+
}) {}
|
|
1859
|
+
export class BetaFileDeleteResponseType extends /*#__PURE__*/S.Literal("file_deleted") {}
|
|
1860
|
+
export class BetaFileDeleteResponse extends /*#__PURE__*/S.Class("BetaFileDeleteResponse")({
|
|
1861
|
+
"id": S.String,
|
|
1862
|
+
"type": /*#__PURE__*/S.optionalWith(BetaFileDeleteResponseType, {
|
|
1863
|
+
nullable: true
|
|
1864
|
+
})
|
|
1865
|
+
}) {}
|
|
1866
|
+
export class BetaDownloadFileV1FilesFileIdContentGetParams extends /*#__PURE__*/S.Struct({
|
|
1867
|
+
"anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1868
|
+
nullable: true
|
|
1869
|
+
}),
|
|
1870
|
+
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1871
|
+
nullable: true
|
|
1872
|
+
}),
|
|
1873
|
+
"x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1874
|
+
nullable: true
|
|
1875
|
+
})
|
|
1876
|
+
}) {}
|
|
1233
1877
|
export const make = (httpClient, options = {}) => {
|
|
1234
1878
|
const unexpectedStatus = (request, response) => Effect.flatMap(Effect.orElseSucceed(response.text, () => "Unexpected status code"), description => Effect.fail(new HttpClientError.ResponseError({
|
|
1235
1879
|
request,
|
|
@@ -1240,186 +1884,284 @@ export const make = (httpClient, options = {}) => {
|
|
|
1240
1884
|
const applyClientTransform = client => options.transformClient ? options.transformClient(client) : Effect.succeed(client);
|
|
1241
1885
|
const decodeError = (response, schema) => Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)(response), Effect.fail);
|
|
1242
1886
|
return {
|
|
1887
|
+
httpClient,
|
|
1243
1888
|
"messagesPost": options => HttpClientRequest.make("POST")(`/v1/messages`).pipe(HttpClientRequest.setHeaders({
|
|
1244
|
-
"anthropic-version": options.params["anthropic-version"] ?? undefined
|
|
1889
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
1245
1890
|
}), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1246
1891
|
"200": r => HttpClientResponse.schemaBodyJson(Message)(r),
|
|
1247
1892
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1248
1893
|
orElse: response => unexpectedStatus(request, response)
|
|
1249
1894
|
}))))),
|
|
1250
1895
|
"completePost": options => HttpClientRequest.make("POST")(`/v1/complete`).pipe(HttpClientRequest.setHeaders({
|
|
1251
|
-
"anthropic-version": options.params["anthropic-version"] ?? undefined
|
|
1896
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined,
|
|
1897
|
+
"anthropic-beta": options.params?.["anthropic-beta"] ?? undefined
|
|
1252
1898
|
}), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1253
1899
|
"200": r => HttpClientResponse.schemaBodyJson(CompletionResponse)(r),
|
|
1254
1900
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1255
1901
|
orElse: response => unexpectedStatus(request, response)
|
|
1256
1902
|
}))))),
|
|
1257
1903
|
"modelsList": options => HttpClientRequest.make("GET")(`/v1/models`).pipe(HttpClientRequest.setUrlParams({
|
|
1258
|
-
"before_id": options["before_id"],
|
|
1259
|
-
"after_id": options["after_id"],
|
|
1260
|
-
"limit": options["limit"]
|
|
1904
|
+
"before_id": options?.["before_id"],
|
|
1905
|
+
"after_id": options?.["after_id"],
|
|
1906
|
+
"limit": options?.["limit"]
|
|
1261
1907
|
}), HttpClientRequest.setHeaders({
|
|
1262
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1263
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
1908
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
1909
|
+
"x-api-key": options?.["x-api-key"] ?? undefined,
|
|
1910
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined
|
|
1264
1911
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1265
1912
|
"200": r => HttpClientResponse.schemaBodyJson(ListResponseModelInfo)(r),
|
|
1266
1913
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1267
1914
|
orElse: response => unexpectedStatus(request, response)
|
|
1268
1915
|
}))))),
|
|
1269
1916
|
"modelsGet": (modelId, options) => HttpClientRequest.make("GET")(`/v1/models/${modelId}`).pipe(HttpClientRequest.setHeaders({
|
|
1270
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1271
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
1917
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
1918
|
+
"x-api-key": options?.["x-api-key"] ?? undefined,
|
|
1919
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined
|
|
1272
1920
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1273
1921
|
"200": r => HttpClientResponse.schemaBodyJson(ModelInfo)(r),
|
|
1274
1922
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1275
1923
|
orElse: response => unexpectedStatus(request, response)
|
|
1276
1924
|
}))))),
|
|
1277
1925
|
"messageBatchesList": options => HttpClientRequest.make("GET")(`/v1/messages/batches`).pipe(HttpClientRequest.setUrlParams({
|
|
1278
|
-
"before_id": options["before_id"],
|
|
1279
|
-
"after_id": options["after_id"],
|
|
1280
|
-
"limit": options["limit"]
|
|
1926
|
+
"before_id": options?.["before_id"],
|
|
1927
|
+
"after_id": options?.["after_id"],
|
|
1928
|
+
"limit": options?.["limit"]
|
|
1281
1929
|
}), HttpClientRequest.setHeaders({
|
|
1282
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1283
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
1930
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
1931
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1284
1932
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1285
1933
|
"200": r => HttpClientResponse.schemaBodyJson(ListResponseMessageBatch)(r),
|
|
1286
1934
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1287
1935
|
orElse: response => unexpectedStatus(request, response)
|
|
1288
1936
|
}))))),
|
|
1289
1937
|
"messageBatchesPost": options => HttpClientRequest.make("POST")(`/v1/messages/batches`).pipe(HttpClientRequest.setHeaders({
|
|
1290
|
-
"anthropic-version": options.params["anthropic-version"] ?? undefined
|
|
1938
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
1291
1939
|
}), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1292
1940
|
"200": r => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
|
|
1293
1941
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1294
1942
|
orElse: response => unexpectedStatus(request, response)
|
|
1295
1943
|
}))))),
|
|
1296
1944
|
"messageBatchesRetrieve": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}`).pipe(HttpClientRequest.setHeaders({
|
|
1297
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1298
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
1945
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
1946
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1299
1947
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1300
1948
|
"200": r => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
|
|
1301
1949
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1302
1950
|
orElse: response => unexpectedStatus(request, response)
|
|
1303
1951
|
}))))),
|
|
1304
1952
|
"messageBatchesDelete": (messageBatchId, options) => HttpClientRequest.make("DELETE")(`/v1/messages/batches/${messageBatchId}`).pipe(HttpClientRequest.setHeaders({
|
|
1305
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1306
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
1953
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
1954
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1307
1955
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1308
1956
|
"200": r => HttpClientResponse.schemaBodyJson(DeleteMessageBatchResponse)(r),
|
|
1309
1957
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1310
1958
|
orElse: response => unexpectedStatus(request, response)
|
|
1311
1959
|
}))))),
|
|
1312
1960
|
"messageBatchesCancel": (messageBatchId, options) => HttpClientRequest.make("POST")(`/v1/messages/batches/${messageBatchId}/cancel`).pipe(HttpClientRequest.setHeaders({
|
|
1313
|
-
"anthropic-version": options["anthropic-version"] ?? undefined
|
|
1961
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined
|
|
1314
1962
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1315
1963
|
"200": r => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
|
|
1316
1964
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1317
1965
|
orElse: response => unexpectedStatus(request, response)
|
|
1318
1966
|
}))))),
|
|
1319
1967
|
"messageBatchesResults": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}/results`).pipe(HttpClientRequest.setHeaders({
|
|
1320
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1321
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
1968
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
1969
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1322
1970
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1323
1971
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1324
1972
|
orElse: response => unexpectedStatus(request, response)
|
|
1325
1973
|
}))))),
|
|
1326
1974
|
"messagesCountTokensPost": options => HttpClientRequest.make("POST")(`/v1/messages/count_tokens`).pipe(HttpClientRequest.setHeaders({
|
|
1327
|
-
"anthropic-version": options.params["anthropic-version"] ?? undefined
|
|
1975
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
1328
1976
|
}), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1329
1977
|
"200": r => HttpClientResponse.schemaBodyJson(CountMessageTokensResponse)(r),
|
|
1330
1978
|
"4xx": r => decodeError(r, ErrorResponse),
|
|
1331
1979
|
orElse: response => unexpectedStatus(request, response)
|
|
1332
1980
|
}))))),
|
|
1981
|
+
"listFilesV1FilesGet": options => HttpClientRequest.make("GET")(`/v1/files`).pipe(HttpClientRequest.setUrlParams({
|
|
1982
|
+
"before_id": options?.["before_id"],
|
|
1983
|
+
"after_id": options?.["after_id"],
|
|
1984
|
+
"limit": options?.["limit"]
|
|
1985
|
+
}), HttpClientRequest.setHeaders({
|
|
1986
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
1987
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
1988
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1989
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1990
|
+
"200": r => HttpClientResponse.schemaBodyJson(FileListResponse)(r),
|
|
1991
|
+
"4xx": r => decodeError(r, ErrorResponse),
|
|
1992
|
+
orElse: response => unexpectedStatus(request, response)
|
|
1993
|
+
}))))),
|
|
1994
|
+
"uploadFileV1FilesPost": options => HttpClientRequest.make("POST")(`/v1/files`).pipe(HttpClientRequest.setHeaders({
|
|
1995
|
+
"anthropic-beta": options.params?.["anthropic-beta"] ?? undefined,
|
|
1996
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
1997
|
+
}), HttpClientRequest.bodyFormData(options.payload), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1998
|
+
"200": r => HttpClientResponse.schemaBodyJson(FileMetadataSchema)(r),
|
|
1999
|
+
"4xx": r => decodeError(r, ErrorResponse),
|
|
2000
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2001
|
+
}))))),
|
|
2002
|
+
"getFileMetadataV1FilesFileIdGet": (fileId, options) => HttpClientRequest.make("GET")(`/v1/files/${fileId}`).pipe(HttpClientRequest.setHeaders({
|
|
2003
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2004
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2005
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
2006
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2007
|
+
"200": r => HttpClientResponse.schemaBodyJson(FileMetadataSchema)(r),
|
|
2008
|
+
"4xx": r => decodeError(r, ErrorResponse),
|
|
2009
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2010
|
+
}))))),
|
|
2011
|
+
"deleteFileV1FilesFileIdDelete": (fileId, options) => HttpClientRequest.make("DELETE")(`/v1/files/${fileId}`).pipe(HttpClientRequest.setHeaders({
|
|
2012
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2013
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2014
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
2015
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2016
|
+
"200": r => HttpClientResponse.schemaBodyJson(FileDeleteResponse)(r),
|
|
2017
|
+
"4xx": r => decodeError(r, ErrorResponse),
|
|
2018
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2019
|
+
}))))),
|
|
2020
|
+
"downloadFileV1FilesFileIdContentGet": (fileId, options) => HttpClientRequest.make("GET")(`/v1/files/${fileId}/content`).pipe(HttpClientRequest.setHeaders({
|
|
2021
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2022
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2023
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
2024
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2025
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2026
|
+
}))))),
|
|
1333
2027
|
"betaMessagesPost": options => HttpClientRequest.make("POST")(`/v1/messages?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1334
|
-
"anthropic-beta": options.params["anthropic-beta"] ?? undefined,
|
|
1335
|
-
"anthropic-version": options.params["anthropic-version"] ?? undefined
|
|
2028
|
+
"anthropic-beta": options.params?.["anthropic-beta"] ?? undefined,
|
|
2029
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
1336
2030
|
}), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1337
2031
|
"200": r => HttpClientResponse.schemaBodyJson(BetaMessage)(r),
|
|
1338
2032
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1339
2033
|
orElse: response => unexpectedStatus(request, response)
|
|
1340
2034
|
}))))),
|
|
1341
2035
|
"betaModelsList": options => HttpClientRequest.make("GET")(`/v1/models?beta=true`).pipe(HttpClientRequest.setUrlParams({
|
|
1342
|
-
"before_id": options["before_id"],
|
|
1343
|
-
"after_id": options["after_id"],
|
|
1344
|
-
"limit": options["limit"]
|
|
2036
|
+
"before_id": options?.["before_id"],
|
|
2037
|
+
"after_id": options?.["after_id"],
|
|
2038
|
+
"limit": options?.["limit"]
|
|
1345
2039
|
}), HttpClientRequest.setHeaders({
|
|
1346
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1347
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
2040
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2041
|
+
"x-api-key": options?.["x-api-key"] ?? undefined,
|
|
2042
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined
|
|
1348
2043
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1349
2044
|
"200": r => HttpClientResponse.schemaBodyJson(BetaListResponseModelInfo)(r),
|
|
1350
2045
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1351
2046
|
orElse: response => unexpectedStatus(request, response)
|
|
1352
2047
|
}))))),
|
|
1353
2048
|
"betaModelsGet": (modelId, options) => HttpClientRequest.make("GET")(`/v1/models/${modelId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1354
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1355
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
2049
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2050
|
+
"x-api-key": options?.["x-api-key"] ?? undefined,
|
|
2051
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined
|
|
1356
2052
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1357
2053
|
"200": r => HttpClientResponse.schemaBodyJson(BetaModelInfo)(r),
|
|
1358
2054
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1359
2055
|
orElse: response => unexpectedStatus(request, response)
|
|
1360
2056
|
}))))),
|
|
1361
2057
|
"betaMessageBatchesList": options => HttpClientRequest.make("GET")(`/v1/messages/batches?beta=true`).pipe(HttpClientRequest.setUrlParams({
|
|
1362
|
-
"before_id": options["before_id"],
|
|
1363
|
-
"after_id": options["after_id"],
|
|
1364
|
-
"limit": options["limit"]
|
|
2058
|
+
"before_id": options?.["before_id"],
|
|
2059
|
+
"after_id": options?.["after_id"],
|
|
2060
|
+
"limit": options?.["limit"]
|
|
1365
2061
|
}), HttpClientRequest.setHeaders({
|
|
1366
|
-
"anthropic-beta": options["anthropic-beta"] ?? undefined,
|
|
1367
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1368
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
2062
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2063
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2064
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1369
2065
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1370
2066
|
"200": r => HttpClientResponse.schemaBodyJson(BetaListResponseMessageBatch)(r),
|
|
1371
2067
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1372
2068
|
orElse: response => unexpectedStatus(request, response)
|
|
1373
2069
|
}))))),
|
|
1374
2070
|
"betaMessageBatchesPost": options => HttpClientRequest.make("POST")(`/v1/messages/batches?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1375
|
-
"anthropic-beta": options.params["anthropic-beta"] ?? undefined,
|
|
1376
|
-
"anthropic-version": options.params["anthropic-version"] ?? undefined
|
|
2071
|
+
"anthropic-beta": options.params?.["anthropic-beta"] ?? undefined,
|
|
2072
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
1377
2073
|
}), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1378
2074
|
"200": r => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
|
|
1379
2075
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1380
2076
|
orElse: response => unexpectedStatus(request, response)
|
|
1381
2077
|
}))))),
|
|
1382
2078
|
"betaMessageBatchesRetrieve": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1383
|
-
"anthropic-beta": options["anthropic-beta"] ?? undefined,
|
|
1384
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1385
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
2079
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2080
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2081
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1386
2082
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1387
2083
|
"200": r => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
|
|
1388
2084
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1389
2085
|
orElse: response => unexpectedStatus(request, response)
|
|
1390
2086
|
}))))),
|
|
1391
2087
|
"betaMessageBatchesDelete": (messageBatchId, options) => HttpClientRequest.make("DELETE")(`/v1/messages/batches/${messageBatchId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1392
|
-
"anthropic-beta": options["anthropic-beta"] ?? undefined,
|
|
1393
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1394
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
2088
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2089
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2090
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1395
2091
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1396
2092
|
"200": r => HttpClientResponse.schemaBodyJson(BetaDeleteMessageBatchResponse)(r),
|
|
1397
2093
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1398
2094
|
orElse: response => unexpectedStatus(request, response)
|
|
1399
2095
|
}))))),
|
|
1400
2096
|
"betaMessageBatchesCancel": (messageBatchId, options) => HttpClientRequest.make("POST")(`/v1/messages/batches/${messageBatchId}/cancel?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1401
|
-
"anthropic-beta": options["anthropic-beta"] ?? undefined,
|
|
1402
|
-
"anthropic-version": options["anthropic-version"] ?? undefined
|
|
2097
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2098
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined
|
|
1403
2099
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1404
2100
|
"200": r => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
|
|
1405
2101
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1406
2102
|
orElse: response => unexpectedStatus(request, response)
|
|
1407
2103
|
}))))),
|
|
1408
2104
|
"betaMessageBatchesResults": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}/results?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1409
|
-
"anthropic-beta": options["anthropic-beta"] ?? undefined,
|
|
1410
|
-
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
1411
|
-
"x-api-key": options["x-api-key"] ?? undefined
|
|
2105
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2106
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2107
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
1412
2108
|
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1413
2109
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1414
2110
|
orElse: response => unexpectedStatus(request, response)
|
|
1415
2111
|
}))))),
|
|
1416
2112
|
"betaMessagesCountTokensPost": options => HttpClientRequest.make("POST")(`/v1/messages/count_tokens?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
1417
|
-
"anthropic-beta": options.params["anthropic-beta"] ?? undefined,
|
|
1418
|
-
"anthropic-version": options.params["anthropic-version"] ?? undefined
|
|
2113
|
+
"anthropic-beta": options.params?.["anthropic-beta"] ?? undefined,
|
|
2114
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
1419
2115
|
}), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
1420
2116
|
"200": r => HttpClientResponse.schemaBodyJson(BetaCountMessageTokensResponse)(r),
|
|
1421
2117
|
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
1422
2118
|
orElse: response => unexpectedStatus(request, response)
|
|
2119
|
+
}))))),
|
|
2120
|
+
"betaListFilesV1FilesGet": options => HttpClientRequest.make("GET")(`/v1/files?beta=true`).pipe(HttpClientRequest.setUrlParams({
|
|
2121
|
+
"before_id": options?.["before_id"],
|
|
2122
|
+
"after_id": options?.["after_id"],
|
|
2123
|
+
"limit": options?.["limit"]
|
|
2124
|
+
}), HttpClientRequest.setHeaders({
|
|
2125
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2126
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2127
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
2128
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2129
|
+
"200": r => HttpClientResponse.schemaBodyJson(BetaFileListResponse)(r),
|
|
2130
|
+
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
2131
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2132
|
+
}))))),
|
|
2133
|
+
"betaUploadFileV1FilesPost": options => HttpClientRequest.make("POST")(`/v1/files?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
2134
|
+
"anthropic-beta": options.params?.["anthropic-beta"] ?? undefined,
|
|
2135
|
+
"anthropic-version": options.params?.["anthropic-version"] ?? undefined
|
|
2136
|
+
}), HttpClientRequest.bodyFormData(options.payload), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2137
|
+
"200": r => HttpClientResponse.schemaBodyJson(BetaFileMetadataSchema)(r),
|
|
2138
|
+
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
2139
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2140
|
+
}))))),
|
|
2141
|
+
"betaGetFileMetadataV1FilesFileIdGet": (fileId, options) => HttpClientRequest.make("GET")(`/v1/files/${fileId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
2142
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2143
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2144
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
2145
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2146
|
+
"200": r => HttpClientResponse.schemaBodyJson(BetaFileMetadataSchema)(r),
|
|
2147
|
+
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
2148
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2149
|
+
}))))),
|
|
2150
|
+
"betaDeleteFileV1FilesFileIdDelete": (fileId, options) => HttpClientRequest.make("DELETE")(`/v1/files/${fileId}?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
2151
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2152
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2153
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
2154
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2155
|
+
"200": r => HttpClientResponse.schemaBodyJson(BetaFileDeleteResponse)(r),
|
|
2156
|
+
"4xx": r => decodeError(r, BetaErrorResponse),
|
|
2157
|
+
orElse: response => unexpectedStatus(request, response)
|
|
2158
|
+
}))))),
|
|
2159
|
+
"betaDownloadFileV1FilesFileIdContentGet": (fileId, options) => HttpClientRequest.make("GET")(`/v1/files/${fileId}/content?beta=true`).pipe(HttpClientRequest.setHeaders({
|
|
2160
|
+
"anthropic-beta": options?.["anthropic-beta"] ?? undefined,
|
|
2161
|
+
"anthropic-version": options?.["anthropic-version"] ?? undefined,
|
|
2162
|
+
"x-api-key": options?.["x-api-key"] ?? undefined
|
|
2163
|
+
}), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
|
|
2164
|
+
orElse: response => unexpectedStatus(request, response)
|
|
1423
2165
|
})))))
|
|
1424
2166
|
};
|
|
1425
2167
|
};
|