@effect/ai-anthropic 0.0.1

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.
Files changed (51) hide show
  1. package/AnthropicClient/package.json +6 -0
  2. package/AnthropicCompletions/package.json +6 -0
  3. package/AnthropicConfig/package.json +6 -0
  4. package/AnthropicTokenizer/package.json +6 -0
  5. package/Generated/package.json +6 -0
  6. package/LICENSE +21 -0
  7. package/README.md +5 -0
  8. package/dist/cjs/AnthropicClient.js +213 -0
  9. package/dist/cjs/AnthropicClient.js.map +1 -0
  10. package/dist/cjs/AnthropicCompletions.js +290 -0
  11. package/dist/cjs/AnthropicCompletions.js.map +1 -0
  12. package/dist/cjs/AnthropicConfig.js +31 -0
  13. package/dist/cjs/AnthropicConfig.js.map +1 -0
  14. package/dist/cjs/AnthropicTokenizer.js +50 -0
  15. package/dist/cjs/AnthropicTokenizer.js.map +1 -0
  16. package/dist/cjs/Generated.js +1510 -0
  17. package/dist/cjs/Generated.js.map +1 -0
  18. package/dist/cjs/index.js +19 -0
  19. package/dist/cjs/index.js.map +1 -0
  20. package/dist/dts/AnthropicClient.d.ts +126 -0
  21. package/dist/dts/AnthropicClient.d.ts.map +1 -0
  22. package/dist/dts/AnthropicCompletions.d.ts +25 -0
  23. package/dist/dts/AnthropicCompletions.d.ts.map +1 -0
  24. package/dist/dts/AnthropicConfig.d.ts +39 -0
  25. package/dist/dts/AnthropicConfig.d.ts.map +1 -0
  26. package/dist/dts/AnthropicTokenizer.d.ts +8 -0
  27. package/dist/dts/AnthropicTokenizer.d.ts.map +1 -0
  28. package/dist/dts/Generated.d.ts +3937 -0
  29. package/dist/dts/Generated.d.ts.map +1 -0
  30. package/dist/dts/index.d.ts +21 -0
  31. package/dist/dts/index.d.ts.map +1 -0
  32. package/dist/esm/AnthropicClient.js +199 -0
  33. package/dist/esm/AnthropicClient.js.map +1 -0
  34. package/dist/esm/AnthropicCompletions.js +279 -0
  35. package/dist/esm/AnthropicCompletions.js.map +1 -0
  36. package/dist/esm/AnthropicConfig.js +22 -0
  37. package/dist/esm/AnthropicConfig.js.map +1 -0
  38. package/dist/esm/AnthropicTokenizer.js +41 -0
  39. package/dist/esm/AnthropicTokenizer.js.map +1 -0
  40. package/dist/esm/Generated.js +1273 -0
  41. package/dist/esm/Generated.js.map +1 -0
  42. package/dist/esm/index.js +21 -0
  43. package/dist/esm/index.js.map +1 -0
  44. package/dist/esm/package.json +4 -0
  45. package/package.json +79 -0
  46. package/src/AnthropicClient.ts +415 -0
  47. package/src/AnthropicCompletions.ts +352 -0
  48. package/src/AnthropicConfig.ts +76 -0
  49. package/src/AnthropicTokenizer.ts +52 -0
  50. package/src/Generated.ts +1811 -0
  51. package/src/index.ts +24 -0
@@ -0,0 +1,1273 @@
1
+ import * as HttpClientError from "@effect/platform/HttpClientError";
2
+ import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
3
+ import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
4
+ import * as Effect from "effect/Effect";
5
+ import * as S from "effect/Schema";
6
+ export class MessagesPostParams extends /*#__PURE__*/S.Struct({
7
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
8
+ nullable: true
9
+ })
10
+ }) {}
11
+ export class ModelEnum extends /*#__PURE__*/S.Literal("claude-3-5-haiku-latest", "claude-3-5-haiku-20241022", "claude-3-5-sonnet-latest", "claude-3-5-sonnet-20241022", "claude-3-5-sonnet-20240620", "claude-3-opus-latest", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", "claude-2.1", "claude-2.0") {}
12
+ export class Model extends /*#__PURE__*/S.Union(S.String, ModelEnum) {}
13
+ export class InputMessageRole extends /*#__PURE__*/S.Literal("user", "assistant") {}
14
+ export class CacheControlEphemeralType extends /*#__PURE__*/S.Literal("ephemeral") {}
15
+ export class CacheControlEphemeral extends /*#__PURE__*/S.Struct({
16
+ "type": CacheControlEphemeralType
17
+ }) {}
18
+ export class RequestCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
19
+ export class RequestCharLocationCitation extends /*#__PURE__*/S.Struct({
20
+ "type": RequestCharLocationCitationType,
21
+ "cited_text": S.String,
22
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
23
+ "document_title": /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
24
+ "start_char_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
25
+ "end_char_index": S.Int
26
+ }) {}
27
+ export class RequestPageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
28
+ export class RequestPageLocationCitation extends /*#__PURE__*/S.Struct({
29
+ "type": RequestPageLocationCitationType,
30
+ "cited_text": S.String,
31
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
32
+ "document_title": /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
33
+ "start_page_number": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
34
+ "end_page_number": S.Int
35
+ }) {}
36
+ export class RequestContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
37
+ export class RequestContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
38
+ "type": RequestContentBlockLocationCitationType,
39
+ "cited_text": S.String,
40
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
41
+ "document_title": /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
42
+ "start_block_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
43
+ "end_block_index": S.Int
44
+ }) {}
45
+ export class RequestTextBlockType extends /*#__PURE__*/S.Literal("text") {}
46
+ export class RequestTextBlock extends /*#__PURE__*/S.Struct({
47
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
48
+ nullable: true
49
+ }),
50
+ "citations": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(RequestCharLocationCitation, RequestPageLocationCitation, RequestContentBlockLocationCitation)), S.Null), {
51
+ nullable: true
52
+ }),
53
+ "text": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1)),
54
+ "type": RequestTextBlockType
55
+ }) {}
56
+ export class RequestImageBlockType extends /*#__PURE__*/S.Literal("image") {}
57
+ export class Base64ImageSourceType extends /*#__PURE__*/S.Literal("base64") {}
58
+ export class Base64ImageSourceMediaType extends /*#__PURE__*/S.Literal("image/jpeg", "image/png", "image/gif", "image/webp") {}
59
+ export class Base64ImageSource extends /*#__PURE__*/S.Struct({
60
+ "type": Base64ImageSourceType,
61
+ "media_type": Base64ImageSourceMediaType,
62
+ "data": S.String
63
+ }) {}
64
+ export class RequestImageBlock extends /*#__PURE__*/S.Struct({
65
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
66
+ nullable: true
67
+ }),
68
+ "type": RequestImageBlockType,
69
+ "source": Base64ImageSource
70
+ }) {}
71
+ export class RequestToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
72
+ export class RequestToolUseBlock extends /*#__PURE__*/S.Struct({
73
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
74
+ nullable: true
75
+ }),
76
+ "type": RequestToolUseBlockType,
77
+ "id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
78
+ "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}$"))),
79
+ "input": /*#__PURE__*/S.Record({
80
+ key: S.String,
81
+ value: S.Unknown
82
+ })
83
+ }) {}
84
+ export class RequestToolResultBlockType extends /*#__PURE__*/S.Literal("tool_result") {}
85
+ export class RequestToolResultBlock extends /*#__PURE__*/S.Struct({
86
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
87
+ nullable: true
88
+ }),
89
+ "type": RequestToolResultBlockType,
90
+ "tool_use_id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
91
+ "is_error": /*#__PURE__*/S.optionalWith(S.Boolean, {
92
+ nullable: true
93
+ }),
94
+ "content": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock))), {
95
+ nullable: true
96
+ })
97
+ }) {}
98
+ export class RequestDocumentBlockType extends /*#__PURE__*/S.Literal("document") {}
99
+ export class Base64PDFSourceType extends /*#__PURE__*/S.Literal("base64") {}
100
+ export class Base64PDFSourceMediaType extends /*#__PURE__*/S.Literal("application/pdf") {}
101
+ export class Base64PDFSource extends /*#__PURE__*/S.Struct({
102
+ "type": Base64PDFSourceType,
103
+ "media_type": Base64PDFSourceMediaType,
104
+ "data": S.String
105
+ }) {}
106
+ export class PlainTextSourceType extends /*#__PURE__*/S.Literal("text") {}
107
+ export class PlainTextSourceMediaType extends /*#__PURE__*/S.Literal("text/plain") {}
108
+ export class PlainTextSource extends /*#__PURE__*/S.Struct({
109
+ "type": PlainTextSourceType,
110
+ "media_type": PlainTextSourceMediaType,
111
+ "data": S.String
112
+ }) {}
113
+ export class ContentBlockSourceType extends /*#__PURE__*/S.Literal("content") {}
114
+ export class ContentBlockSource extends /*#__PURE__*/S.Struct({
115
+ "type": ContentBlockSourceType,
116
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock)))
117
+ }) {}
118
+ export class RequestCitationsConfig extends /*#__PURE__*/S.Struct({
119
+ "enabled": /*#__PURE__*/S.optionalWith(S.Boolean, {
120
+ nullable: true
121
+ })
122
+ }) {}
123
+ export class RequestDocumentBlock extends /*#__PURE__*/S.Struct({
124
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
125
+ nullable: true
126
+ }),
127
+ "type": RequestDocumentBlockType,
128
+ "source": /*#__PURE__*/S.Union(Base64PDFSource, PlainTextSource, ContentBlockSource),
129
+ "title": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
130
+ nullable: true
131
+ }),
132
+ "context": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1)), S.Null), {
133
+ nullable: true
134
+ }),
135
+ "citations": /*#__PURE__*/S.optionalWith(RequestCitationsConfig, {
136
+ nullable: true
137
+ })
138
+ }) {}
139
+ export class InputContentBlock extends /*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock, RequestToolUseBlock, RequestToolResultBlock, RequestDocumentBlock) {}
140
+ export class InputMessage extends /*#__PURE__*/S.Struct({
141
+ "role": InputMessageRole,
142
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(InputContentBlock))
143
+ }) {}
144
+ export class Metadata extends /*#__PURE__*/S.Struct({
145
+ "user_id": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256)), S.Null), {
146
+ nullable: true
147
+ })
148
+ }) {}
149
+ export class ToolChoiceAutoType extends /*#__PURE__*/S.Literal("auto") {}
150
+ export class ToolChoiceAuto extends /*#__PURE__*/S.Struct({
151
+ "type": ToolChoiceAutoType,
152
+ "disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
153
+ nullable: true
154
+ })
155
+ }) {}
156
+ export class ToolChoiceAnyType extends /*#__PURE__*/S.Literal("any") {}
157
+ export class ToolChoiceAny extends /*#__PURE__*/S.Struct({
158
+ "type": ToolChoiceAnyType,
159
+ "disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
160
+ nullable: true
161
+ })
162
+ }) {}
163
+ export class ToolChoiceToolType extends /*#__PURE__*/S.Literal("tool") {}
164
+ export class ToolChoiceTool extends /*#__PURE__*/S.Struct({
165
+ "type": ToolChoiceToolType,
166
+ "name": S.String,
167
+ "disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
168
+ nullable: true
169
+ })
170
+ }) {}
171
+ export class ToolChoice extends /*#__PURE__*/S.Union(ToolChoiceAuto, ToolChoiceAny, ToolChoiceTool) {}
172
+ export class InputSchemaType extends /*#__PURE__*/S.Literal("object") {}
173
+ export class InputSchema extends /*#__PURE__*/S.Struct({
174
+ "type": InputSchemaType,
175
+ "properties": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Record({
176
+ key: S.String,
177
+ value: S.Unknown
178
+ }), S.Null), {
179
+ nullable: true
180
+ })
181
+ }) {}
182
+ export class Tool extends /*#__PURE__*/S.Struct({
183
+ "description": /*#__PURE__*/S.optionalWith(S.String, {
184
+ nullable: true
185
+ }),
186
+ "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}$"))),
187
+ "input_schema": InputSchema,
188
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
189
+ nullable: true
190
+ })
191
+ }) {}
192
+ export class CreateMessageParams extends /*#__PURE__*/S.Class("CreateMessageParams")({
193
+ "model": Model,
194
+ "messages": /*#__PURE__*/S.Array(InputMessage),
195
+ "max_tokens": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
196
+ "metadata": /*#__PURE__*/S.optionalWith(Metadata, {
197
+ nullable: true
198
+ }),
199
+ "stop_sequences": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String), {
200
+ nullable: true
201
+ }),
202
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
203
+ nullable: true
204
+ }),
205
+ "system": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(RequestTextBlock)), {
206
+ nullable: true
207
+ }),
208
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
209
+ nullable: true
210
+ }),
211
+ "tool_choice": /*#__PURE__*/S.optionalWith(ToolChoice, {
212
+ nullable: true
213
+ }),
214
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(Tool), {
215
+ nullable: true
216
+ }),
217
+ "top_k": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), {
218
+ nullable: true
219
+ }),
220
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
221
+ nullable: true
222
+ })
223
+ }) {}
224
+ export class MessageType extends /*#__PURE__*/S.Literal("message") {}
225
+ export class MessageRole extends /*#__PURE__*/S.Literal("assistant") {}
226
+ export class ResponseTextBlockType extends /*#__PURE__*/S.Literal("text") {}
227
+ export class ResponseCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
228
+ export class ResponseCharLocationCitation extends /*#__PURE__*/S.Struct({
229
+ "type": /*#__PURE__*/ResponseCharLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "char_location")),
230
+ "cited_text": S.String,
231
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
232
+ "document_title": /*#__PURE__*/S.Union(S.String, S.Null),
233
+ "start_char_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
234
+ "end_char_index": S.Int
235
+ }) {}
236
+ export class ResponsePageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
237
+ export class ResponsePageLocationCitation extends /*#__PURE__*/S.Struct({
238
+ "type": /*#__PURE__*/ResponsePageLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "page_location")),
239
+ "cited_text": S.String,
240
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
241
+ "document_title": /*#__PURE__*/S.Union(S.String, S.Null),
242
+ "start_page_number": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
243
+ "end_page_number": S.Int
244
+ }) {}
245
+ export class ResponseContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
246
+ export class ResponseContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
247
+ "type": /*#__PURE__*/ResponseContentBlockLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "content_block_location")),
248
+ "cited_text": S.String,
249
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
250
+ "document_title": /*#__PURE__*/S.Union(S.String, S.Null),
251
+ "start_block_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
252
+ "end_block_index": S.Int
253
+ }) {}
254
+ export class ResponseTextBlock extends /*#__PURE__*/S.Struct({
255
+ "type": /*#__PURE__*/ResponseTextBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "text")),
256
+ "text": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(0), /*#__PURE__*/S.maxLength(5000000)),
257
+ "citations": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(ResponseCharLocationCitation, ResponsePageLocationCitation, ResponseContentBlockLocationCitation)), S.Null)), {
258
+ default: () => null
259
+ })
260
+ }) {}
261
+ export class ResponseToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
262
+ export class ResponseToolUseBlock extends /*#__PURE__*/S.Struct({
263
+ "type": /*#__PURE__*/ResponseToolUseBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "tool_use")),
264
+ "id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
265
+ "name": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1)),
266
+ "input": /*#__PURE__*/S.Record({
267
+ key: S.String,
268
+ value: S.Unknown
269
+ })
270
+ }) {}
271
+ export class ContentBlock extends /*#__PURE__*/S.Union(ResponseTextBlock, ResponseToolUseBlock) {}
272
+ export class MessageStopReasonEnum extends /*#__PURE__*/S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use") {}
273
+ export class Usage extends /*#__PURE__*/S.Struct({
274
+ "input_tokens": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
275
+ "cache_creation_input_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
276
+ default: () => null
277
+ }),
278
+ "cache_read_input_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
279
+ default: () => null
280
+ }),
281
+ "output_tokens": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0))
282
+ }) {}
283
+ export class Message extends /*#__PURE__*/S.Class("Message")({
284
+ "id": S.String,
285
+ "type": /*#__PURE__*/MessageType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message")),
286
+ "role": /*#__PURE__*/MessageRole.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "assistant")),
287
+ "content": /*#__PURE__*/S.Array(ContentBlock),
288
+ "model": Model,
289
+ "stop_reason": /*#__PURE__*/S.Union(MessageStopReasonEnum, S.Null),
290
+ "stop_sequence": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union(S.String, S.Null)), {
291
+ default: () => null
292
+ }),
293
+ "usage": Usage
294
+ }) {}
295
+ export class ErrorResponseType extends /*#__PURE__*/S.Literal("error") {}
296
+ export class InvalidRequestErrorType extends /*#__PURE__*/S.Literal("invalid_request_error") {}
297
+ export class InvalidRequestError extends /*#__PURE__*/S.Struct({
298
+ "type": /*#__PURE__*/InvalidRequestErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "invalid_request_error")),
299
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Invalid request"))
300
+ }) {}
301
+ export class AuthenticationErrorType extends /*#__PURE__*/S.Literal("authentication_error") {}
302
+ export class AuthenticationError extends /*#__PURE__*/S.Struct({
303
+ "type": /*#__PURE__*/AuthenticationErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "authentication_error")),
304
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Authentication error"))
305
+ }) {}
306
+ export class BillingErrorType extends /*#__PURE__*/S.Literal("billing_error") {}
307
+ export class BillingError extends /*#__PURE__*/S.Struct({
308
+ "type": /*#__PURE__*/BillingErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "billing_error")),
309
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Billing error"))
310
+ }) {}
311
+ export class PermissionErrorType extends /*#__PURE__*/S.Literal("permission_error") {}
312
+ export class PermissionError extends /*#__PURE__*/S.Struct({
313
+ "type": /*#__PURE__*/PermissionErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "permission_error")),
314
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Permission denied"))
315
+ }) {}
316
+ export class NotFoundErrorType extends /*#__PURE__*/S.Literal("not_found_error") {}
317
+ export class NotFoundError extends /*#__PURE__*/S.Struct({
318
+ "type": /*#__PURE__*/NotFoundErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "not_found_error")),
319
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Not found"))
320
+ }) {}
321
+ export class RateLimitErrorType extends /*#__PURE__*/S.Literal("rate_limit_error") {}
322
+ export class RateLimitError extends /*#__PURE__*/S.Struct({
323
+ "type": /*#__PURE__*/RateLimitErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "rate_limit_error")),
324
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Rate limited"))
325
+ }) {}
326
+ export class GatewayTimeoutErrorType extends /*#__PURE__*/S.Literal("timeout_error") {}
327
+ export class GatewayTimeoutError extends /*#__PURE__*/S.Struct({
328
+ "type": /*#__PURE__*/GatewayTimeoutErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "timeout_error")),
329
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Request timeout"))
330
+ }) {}
331
+ export class APIErrorType extends /*#__PURE__*/S.Literal("api_error") {}
332
+ export class APIError extends /*#__PURE__*/S.Struct({
333
+ "type": /*#__PURE__*/APIErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "api_error")),
334
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Internal server error"))
335
+ }) {}
336
+ export class OverloadedErrorType extends /*#__PURE__*/S.Literal("overloaded_error") {}
337
+ export class OverloadedError extends /*#__PURE__*/S.Struct({
338
+ "type": /*#__PURE__*/OverloadedErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "overloaded_error")),
339
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Overloaded"))
340
+ }) {}
341
+ export class ErrorResponse extends /*#__PURE__*/S.Class("ErrorResponse")({
342
+ "type": /*#__PURE__*/ErrorResponseType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "error")),
343
+ "error": /*#__PURE__*/S.Union(InvalidRequestError, AuthenticationError, BillingError, PermissionError, NotFoundError, RateLimitError, GatewayTimeoutError, APIError, OverloadedError)
344
+ }) {}
345
+ export class CompletePostParams extends /*#__PURE__*/S.Struct({
346
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
347
+ nullable: true
348
+ })
349
+ }) {}
350
+ export class CompletionRequest extends /*#__PURE__*/S.Class("CompletionRequest")({
351
+ "model": Model,
352
+ "prompt": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1)),
353
+ "max_tokens_to_sample": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
354
+ "stop_sequences": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String), {
355
+ nullable: true
356
+ }),
357
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
358
+ nullable: true
359
+ }),
360
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
361
+ nullable: true
362
+ }),
363
+ "top_k": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), {
364
+ nullable: true
365
+ }),
366
+ "metadata": /*#__PURE__*/S.optionalWith(Metadata, {
367
+ nullable: true
368
+ }),
369
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
370
+ nullable: true
371
+ })
372
+ }) {}
373
+ export class CompletionResponseType extends /*#__PURE__*/S.Literal("completion") {}
374
+ export class CompletionResponse extends /*#__PURE__*/S.Class("CompletionResponse")({
375
+ "type": /*#__PURE__*/CompletionResponseType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "completion")),
376
+ "id": S.String,
377
+ "completion": S.String,
378
+ "stop_reason": /*#__PURE__*/S.Union(S.String, S.Null),
379
+ "model": Model
380
+ }) {}
381
+ export class ModelsListParams extends /*#__PURE__*/S.Struct({
382
+ "before_id": /*#__PURE__*/S.optionalWith(S.String, {
383
+ nullable: true
384
+ }),
385
+ "after_id": /*#__PURE__*/S.optionalWith(S.String, {
386
+ nullable: true
387
+ }),
388
+ "limit": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
389
+ nullable: true,
390
+ default: () => 20
391
+ }),
392
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
393
+ nullable: true
394
+ }),
395
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
396
+ nullable: true
397
+ })
398
+ }) {}
399
+ export class ModelInfoType extends /*#__PURE__*/S.Literal("model") {}
400
+ export class ModelInfo extends /*#__PURE__*/S.Struct({
401
+ "type": /*#__PURE__*/ModelInfoType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "model")),
402
+ "id": S.String,
403
+ "display_name": S.String,
404
+ "created_at": S.String
405
+ }) {}
406
+ export class ListResponseModelInfo extends /*#__PURE__*/S.Class("ListResponseModelInfo")({
407
+ "data": /*#__PURE__*/S.Array(ModelInfo),
408
+ "has_more": S.Boolean,
409
+ "first_id": /*#__PURE__*/S.Union(S.String, S.Null),
410
+ "last_id": /*#__PURE__*/S.Union(S.String, S.Null)
411
+ }) {}
412
+ export class ModelsGetParams extends /*#__PURE__*/S.Struct({
413
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
414
+ nullable: true
415
+ }),
416
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
417
+ nullable: true
418
+ })
419
+ }) {}
420
+ export class MessageBatchesListParams extends /*#__PURE__*/S.Struct({
421
+ "before_id": /*#__PURE__*/S.optionalWith(S.String, {
422
+ nullable: true
423
+ }),
424
+ "after_id": /*#__PURE__*/S.optionalWith(S.String, {
425
+ nullable: true
426
+ }),
427
+ "limit": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
428
+ nullable: true,
429
+ default: () => 20
430
+ }),
431
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
432
+ nullable: true
433
+ }),
434
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
435
+ nullable: true
436
+ })
437
+ }) {}
438
+ export class MessageBatchType extends /*#__PURE__*/S.Literal("message_batch") {}
439
+ export class MessageBatchProcessingStatus extends /*#__PURE__*/S.Literal("in_progress", "canceling", "ended") {}
440
+ export class RequestCounts extends /*#__PURE__*/S.Struct({
441
+ "processing": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
442
+ "succeeded": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
443
+ "errored": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
444
+ "canceled": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
445
+ "expired": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0))
446
+ }) {}
447
+ export class MessageBatch extends /*#__PURE__*/S.Struct({
448
+ "id": S.String,
449
+ "type": /*#__PURE__*/MessageBatchType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message_batch")),
450
+ "processing_status": MessageBatchProcessingStatus,
451
+ "request_counts": RequestCounts,
452
+ "ended_at": /*#__PURE__*/S.Union(S.String, S.Null),
453
+ "created_at": S.String,
454
+ "expires_at": S.String,
455
+ "archived_at": /*#__PURE__*/S.Union(S.String, S.Null),
456
+ "cancel_initiated_at": /*#__PURE__*/S.Union(S.String, S.Null),
457
+ "results_url": /*#__PURE__*/S.Union(S.String, S.Null)
458
+ }) {}
459
+ export class ListResponseMessageBatch extends /*#__PURE__*/S.Class("ListResponseMessageBatch")({
460
+ "data": /*#__PURE__*/S.Array(MessageBatch),
461
+ "has_more": S.Boolean,
462
+ "first_id": /*#__PURE__*/S.Union(S.String, S.Null),
463
+ "last_id": /*#__PURE__*/S.Union(S.String, S.Null)
464
+ }) {}
465
+ export class MessageBatchesPostParams extends /*#__PURE__*/S.Struct({
466
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
467
+ nullable: true
468
+ })
469
+ }) {}
470
+ export class MessageBatchIndividualRequestParams extends /*#__PURE__*/S.Struct({
471
+ "custom_id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(64), /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]{1,64}$"))),
472
+ "params": CreateMessageParams
473
+ }) {}
474
+ export class CreateMessageBatchParams extends /*#__PURE__*/S.Class("CreateMessageBatchParams")({
475
+ "requests": /*#__PURE__*/S.Array(MessageBatchIndividualRequestParams).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(10000))
476
+ }) {}
477
+ export class MessageBatchesRetrieveParams extends /*#__PURE__*/S.Struct({
478
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
479
+ nullable: true
480
+ }),
481
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
482
+ nullable: true
483
+ })
484
+ }) {}
485
+ export class MessageBatchesDeleteParams extends /*#__PURE__*/S.Struct({
486
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
487
+ nullable: true
488
+ }),
489
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
490
+ nullable: true
491
+ })
492
+ }) {}
493
+ export class DeleteMessageBatchResponseType extends /*#__PURE__*/S.Literal("message_batch_deleted") {}
494
+ export class DeleteMessageBatchResponse extends /*#__PURE__*/S.Class("DeleteMessageBatchResponse")({
495
+ "id": S.String,
496
+ "type": /*#__PURE__*/DeleteMessageBatchResponseType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message_batch_deleted"))
497
+ }) {}
498
+ export class MessageBatchesCancelParams extends /*#__PURE__*/S.Struct({
499
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
500
+ nullable: true
501
+ })
502
+ }) {}
503
+ export class MessageBatchesResultsParams extends /*#__PURE__*/S.Struct({
504
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
505
+ nullable: true
506
+ }),
507
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
508
+ nullable: true
509
+ })
510
+ }) {}
511
+ export class MessagesCountTokensPostParams extends /*#__PURE__*/S.Struct({
512
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
513
+ nullable: true
514
+ })
515
+ }) {}
516
+ export class CountMessageTokensParams extends /*#__PURE__*/S.Class("CountMessageTokensParams")({
517
+ "tool_choice": /*#__PURE__*/S.optionalWith(ToolChoice, {
518
+ nullable: true
519
+ }),
520
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(Tool), {
521
+ nullable: true
522
+ }),
523
+ "messages": /*#__PURE__*/S.Array(InputMessage),
524
+ "system": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(RequestTextBlock)), {
525
+ nullable: true
526
+ }),
527
+ "model": Model
528
+ }) {}
529
+ export class CountMessageTokensResponse extends /*#__PURE__*/S.Class("CountMessageTokensResponse")({
530
+ "input_tokens": S.Int
531
+ }) {}
532
+ export class BetaMessagesPostParams extends /*#__PURE__*/S.Struct({
533
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
534
+ nullable: true
535
+ }),
536
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
537
+ nullable: true
538
+ })
539
+ }) {}
540
+ export class BetaInputMessageRole extends /*#__PURE__*/S.Literal("user", "assistant") {}
541
+ export class BetaCacheControlEphemeralType extends /*#__PURE__*/S.Literal("ephemeral") {}
542
+ export class BetaCacheControlEphemeral extends /*#__PURE__*/S.Struct({
543
+ "type": BetaCacheControlEphemeralType
544
+ }) {}
545
+ export class BetaRequestCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
546
+ export class BetaRequestCharLocationCitation extends /*#__PURE__*/S.Struct({
547
+ "type": BetaRequestCharLocationCitationType,
548
+ "cited_text": S.String,
549
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
550
+ "document_title": /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
551
+ "start_char_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
552
+ "end_char_index": S.Int
553
+ }) {}
554
+ export class BetaRequestPageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
555
+ export class BetaRequestPageLocationCitation extends /*#__PURE__*/S.Struct({
556
+ "type": BetaRequestPageLocationCitationType,
557
+ "cited_text": S.String,
558
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
559
+ "document_title": /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
560
+ "start_page_number": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
561
+ "end_page_number": S.Int
562
+ }) {}
563
+ export class BetaRequestContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
564
+ export class BetaRequestContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
565
+ "type": BetaRequestContentBlockLocationCitationType,
566
+ "cited_text": S.String,
567
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
568
+ "document_title": /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
569
+ "start_block_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
570
+ "end_block_index": S.Int
571
+ }) {}
572
+ export class BetaRequestTextBlockType extends /*#__PURE__*/S.Literal("text") {}
573
+ export class BetaRequestTextBlock extends /*#__PURE__*/S.Struct({
574
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
575
+ nullable: true
576
+ }),
577
+ "citations": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(BetaRequestCharLocationCitation, BetaRequestPageLocationCitation, BetaRequestContentBlockLocationCitation)), S.Null), {
578
+ nullable: true
579
+ }),
580
+ "text": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1)),
581
+ "type": BetaRequestTextBlockType
582
+ }) {}
583
+ export class BetaRequestImageBlockType extends /*#__PURE__*/S.Literal("image") {}
584
+ export class BetaBase64ImageSourceType extends /*#__PURE__*/S.Literal("base64") {}
585
+ export class BetaBase64ImageSourceMediaType extends /*#__PURE__*/S.Literal("image/jpeg", "image/png", "image/gif", "image/webp") {}
586
+ export class BetaBase64ImageSource extends /*#__PURE__*/S.Struct({
587
+ "type": BetaBase64ImageSourceType,
588
+ "media_type": BetaBase64ImageSourceMediaType,
589
+ "data": S.String
590
+ }) {}
591
+ export class BetaRequestImageBlock extends /*#__PURE__*/S.Struct({
592
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
593
+ nullable: true
594
+ }),
595
+ "type": BetaRequestImageBlockType,
596
+ "source": BetaBase64ImageSource
597
+ }) {}
598
+ export class BetaRequestToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
599
+ export class BetaRequestToolUseBlock extends /*#__PURE__*/S.Struct({
600
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
601
+ nullable: true
602
+ }),
603
+ "type": BetaRequestToolUseBlockType,
604
+ "id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
605
+ "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}$"))),
606
+ "input": /*#__PURE__*/S.Record({
607
+ key: S.String,
608
+ value: S.Unknown
609
+ })
610
+ }) {}
611
+ export class BetaRequestToolResultBlockType extends /*#__PURE__*/S.Literal("tool_result") {}
612
+ export class BetaRequestToolResultBlock extends /*#__PURE__*/S.Struct({
613
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
614
+ nullable: true
615
+ }),
616
+ "type": BetaRequestToolResultBlockType,
617
+ "tool_use_id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
618
+ "is_error": /*#__PURE__*/S.optionalWith(S.Boolean, {
619
+ nullable: true
620
+ }),
621
+ "content": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock))), {
622
+ nullable: true
623
+ })
624
+ }) {}
625
+ export class BetaRequestDocumentBlockType extends /*#__PURE__*/S.Literal("document") {}
626
+ export class BetaBase64PDFSourceType extends /*#__PURE__*/S.Literal("base64") {}
627
+ export class BetaBase64PDFSourceMediaType extends /*#__PURE__*/S.Literal("application/pdf") {}
628
+ export class BetaBase64PDFSource extends /*#__PURE__*/S.Struct({
629
+ "type": BetaBase64PDFSourceType,
630
+ "media_type": BetaBase64PDFSourceMediaType,
631
+ "data": S.String
632
+ }) {}
633
+ export class BetaPlainTextSourceType extends /*#__PURE__*/S.Literal("text") {}
634
+ export class BetaPlainTextSourceMediaType extends /*#__PURE__*/S.Literal("text/plain") {}
635
+ export class BetaPlainTextSource extends /*#__PURE__*/S.Struct({
636
+ "type": BetaPlainTextSourceType,
637
+ "media_type": BetaPlainTextSourceMediaType,
638
+ "data": S.String
639
+ }) {}
640
+ export class BetaContentBlockSourceType extends /*#__PURE__*/S.Literal("content") {}
641
+ export class BetaContentBlockSource extends /*#__PURE__*/S.Struct({
642
+ "type": BetaContentBlockSourceType,
643
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock)))
644
+ }) {}
645
+ export class BetaRequestCitationsConfig extends /*#__PURE__*/S.Struct({
646
+ "enabled": /*#__PURE__*/S.optionalWith(S.Boolean, {
647
+ nullable: true
648
+ })
649
+ }) {}
650
+ export class BetaRequestDocumentBlock extends /*#__PURE__*/S.Struct({
651
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
652
+ nullable: true
653
+ }),
654
+ "type": BetaRequestDocumentBlockType,
655
+ "source": /*#__PURE__*/S.Union(BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource),
656
+ "title": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null), {
657
+ nullable: true
658
+ }),
659
+ "context": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1)), S.Null), {
660
+ nullable: true
661
+ }),
662
+ "citations": /*#__PURE__*/S.optionalWith(BetaRequestCitationsConfig, {
663
+ nullable: true
664
+ })
665
+ }) {}
666
+ export class BetaInputContentBlock extends /*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock, BetaRequestToolUseBlock, BetaRequestToolResultBlock, BetaRequestDocumentBlock) {}
667
+ export class BetaInputMessage extends /*#__PURE__*/S.Struct({
668
+ "role": BetaInputMessageRole,
669
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaInputContentBlock))
670
+ }) {}
671
+ export class BetaMetadata extends /*#__PURE__*/S.Struct({
672
+ "user_id": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256)), S.Null), {
673
+ nullable: true
674
+ })
675
+ }) {}
676
+ export class BetaToolChoiceAutoType extends /*#__PURE__*/S.Literal("auto") {}
677
+ export class BetaToolChoiceAuto extends /*#__PURE__*/S.Struct({
678
+ "type": BetaToolChoiceAutoType,
679
+ "disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
680
+ nullable: true
681
+ })
682
+ }) {}
683
+ export class BetaToolChoiceAnyType extends /*#__PURE__*/S.Literal("any") {}
684
+ export class BetaToolChoiceAny extends /*#__PURE__*/S.Struct({
685
+ "type": BetaToolChoiceAnyType,
686
+ "disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
687
+ nullable: true
688
+ })
689
+ }) {}
690
+ export class BetaToolChoiceToolType extends /*#__PURE__*/S.Literal("tool") {}
691
+ export class BetaToolChoiceTool extends /*#__PURE__*/S.Struct({
692
+ "type": BetaToolChoiceToolType,
693
+ "name": S.String,
694
+ "disable_parallel_tool_use": /*#__PURE__*/S.optionalWith(S.Boolean, {
695
+ nullable: true
696
+ })
697
+ }) {}
698
+ export class BetaToolChoice extends /*#__PURE__*/S.Union(BetaToolChoiceAuto, BetaToolChoiceAny, BetaToolChoiceTool) {}
699
+ export class BetaToolTypeEnum extends /*#__PURE__*/S.Literal("custom") {}
700
+ export class BetaInputSchemaType extends /*#__PURE__*/S.Literal("object") {}
701
+ export class BetaInputSchema extends /*#__PURE__*/S.Struct({
702
+ "type": BetaInputSchemaType,
703
+ "properties": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Record({
704
+ key: S.String,
705
+ value: S.Unknown
706
+ }), S.Null), {
707
+ nullable: true
708
+ })
709
+ }) {}
710
+ export class BetaTool extends /*#__PURE__*/S.Struct({
711
+ "type": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.Null, BetaToolTypeEnum), {
712
+ nullable: true
713
+ }),
714
+ "description": /*#__PURE__*/S.optionalWith(S.String, {
715
+ nullable: true
716
+ }),
717
+ "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}$"))),
718
+ "input_schema": BetaInputSchema,
719
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
720
+ nullable: true
721
+ })
722
+ }) {}
723
+ export class BetaComputerUseTool20241022Type extends /*#__PURE__*/S.Literal("computer_20241022") {}
724
+ export class BetaComputerUseTool20241022Name extends /*#__PURE__*/S.Literal("computer") {}
725
+ export class BetaComputerUseTool20241022 extends /*#__PURE__*/S.Struct({
726
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
727
+ nullable: true
728
+ }),
729
+ "type": BetaComputerUseTool20241022Type,
730
+ "name": BetaComputerUseTool20241022Name,
731
+ "display_height_px": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
732
+ "display_width_px": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
733
+ "display_number": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null), {
734
+ nullable: true
735
+ })
736
+ }) {}
737
+ export class BetaBashTool20241022Type extends /*#__PURE__*/S.Literal("bash_20241022") {}
738
+ export class BetaBashTool20241022Name extends /*#__PURE__*/S.Literal("bash") {}
739
+ export class BetaBashTool20241022 extends /*#__PURE__*/S.Struct({
740
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
741
+ nullable: true
742
+ }),
743
+ "type": BetaBashTool20241022Type,
744
+ "name": BetaBashTool20241022Name
745
+ }) {}
746
+ export class BetaTextEditor20241022Type extends /*#__PURE__*/S.Literal("text_editor_20241022") {}
747
+ export class BetaTextEditor20241022Name extends /*#__PURE__*/S.Literal("str_replace_editor") {}
748
+ export class BetaTextEditor20241022 extends /*#__PURE__*/S.Struct({
749
+ "cache_control": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
750
+ nullable: true
751
+ }),
752
+ "type": BetaTextEditor20241022Type,
753
+ "name": BetaTextEditor20241022Name
754
+ }) {}
755
+ export class BetaCreateMessageParams extends /*#__PURE__*/S.Class("BetaCreateMessageParams")({
756
+ "model": Model,
757
+ "messages": /*#__PURE__*/S.Array(BetaInputMessage),
758
+ "max_tokens": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
759
+ "metadata": /*#__PURE__*/S.optionalWith(BetaMetadata, {
760
+ nullable: true
761
+ }),
762
+ "stop_sequences": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String), {
763
+ nullable: true
764
+ }),
765
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
766
+ nullable: true
767
+ }),
768
+ "system": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaRequestTextBlock)), {
769
+ nullable: true
770
+ }),
771
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
772
+ nullable: true
773
+ }),
774
+ "tool_choice": /*#__PURE__*/S.optionalWith(BetaToolChoice, {
775
+ nullable: true
776
+ }),
777
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022)), {
778
+ nullable: true
779
+ }),
780
+ "top_k": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), {
781
+ nullable: true
782
+ }),
783
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
784
+ nullable: true
785
+ })
786
+ }) {}
787
+ export class BetaMessageType extends /*#__PURE__*/S.Literal("message") {}
788
+ export class BetaMessageRole extends /*#__PURE__*/S.Literal("assistant") {}
789
+ export class BetaResponseTextBlockType extends /*#__PURE__*/S.Literal("text") {}
790
+ export class BetaResponseCharLocationCitationType extends /*#__PURE__*/S.Literal("char_location") {}
791
+ export class BetaResponseCharLocationCitation extends /*#__PURE__*/S.Struct({
792
+ "type": /*#__PURE__*/BetaResponseCharLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "char_location")),
793
+ "cited_text": S.String,
794
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
795
+ "document_title": /*#__PURE__*/S.Union(S.String, S.Null),
796
+ "start_char_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
797
+ "end_char_index": S.Int
798
+ }) {}
799
+ export class BetaResponsePageLocationCitationType extends /*#__PURE__*/S.Literal("page_location") {}
800
+ export class BetaResponsePageLocationCitation extends /*#__PURE__*/S.Struct({
801
+ "type": /*#__PURE__*/BetaResponsePageLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "page_location")),
802
+ "cited_text": S.String,
803
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
804
+ "document_title": /*#__PURE__*/S.Union(S.String, S.Null),
805
+ "start_page_number": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)),
806
+ "end_page_number": S.Int
807
+ }) {}
808
+ export class BetaResponseContentBlockLocationCitationType extends /*#__PURE__*/S.Literal("content_block_location") {}
809
+ export class BetaResponseContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
810
+ "type": /*#__PURE__*/BetaResponseContentBlockLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "content_block_location")),
811
+ "cited_text": S.String,
812
+ "document_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
813
+ "document_title": /*#__PURE__*/S.Union(S.String, S.Null),
814
+ "start_block_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
815
+ "end_block_index": S.Int
816
+ }) {}
817
+ export class BetaResponseTextBlock extends /*#__PURE__*/S.Struct({
818
+ "type": /*#__PURE__*/BetaResponseTextBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "text")),
819
+ "text": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(0), /*#__PURE__*/S.maxLength(5000000)),
820
+ "citations": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(BetaResponseCharLocationCitation, BetaResponsePageLocationCitation, BetaResponseContentBlockLocationCitation)), S.Null)), {
821
+ default: () => null
822
+ })
823
+ }) {}
824
+ export class BetaResponseToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
825
+ export class BetaResponseToolUseBlock extends /*#__PURE__*/S.Struct({
826
+ "type": /*#__PURE__*/BetaResponseToolUseBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "tool_use")),
827
+ "id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
828
+ "name": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1)),
829
+ "input": /*#__PURE__*/S.Record({
830
+ key: S.String,
831
+ value: S.Unknown
832
+ })
833
+ }) {}
834
+ export class BetaContentBlock extends /*#__PURE__*/S.Union(BetaResponseTextBlock, BetaResponseToolUseBlock) {}
835
+ export class BetaMessageStopReasonEnum extends /*#__PURE__*/S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use") {}
836
+ export class BetaUsage extends /*#__PURE__*/S.Struct({
837
+ "input_tokens": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
838
+ "cache_creation_input_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
839
+ default: () => null
840
+ }),
841
+ "cache_read_input_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
842
+ default: () => null
843
+ }),
844
+ "output_tokens": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0))
845
+ }) {}
846
+ export class BetaMessage extends /*#__PURE__*/S.Class("BetaMessage")({
847
+ "id": S.String,
848
+ "type": /*#__PURE__*/BetaMessageType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message")),
849
+ "role": /*#__PURE__*/BetaMessageRole.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "assistant")),
850
+ "content": /*#__PURE__*/S.Array(BetaContentBlock),
851
+ "model": Model,
852
+ "stop_reason": /*#__PURE__*/S.Union(BetaMessageStopReasonEnum, S.Null),
853
+ "stop_sequence": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Union(S.String, S.Null)), {
854
+ default: () => null
855
+ }),
856
+ "usage": BetaUsage
857
+ }) {}
858
+ export class BetaErrorResponseType extends /*#__PURE__*/S.Literal("error") {}
859
+ export class BetaInvalidRequestErrorType extends /*#__PURE__*/S.Literal("invalid_request_error") {}
860
+ export class BetaInvalidRequestError extends /*#__PURE__*/S.Struct({
861
+ "type": /*#__PURE__*/BetaInvalidRequestErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "invalid_request_error")),
862
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Invalid request"))
863
+ }) {}
864
+ export class BetaAuthenticationErrorType extends /*#__PURE__*/S.Literal("authentication_error") {}
865
+ export class BetaAuthenticationError extends /*#__PURE__*/S.Struct({
866
+ "type": /*#__PURE__*/BetaAuthenticationErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "authentication_error")),
867
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Authentication error"))
868
+ }) {}
869
+ export class BetaBillingErrorType extends /*#__PURE__*/S.Literal("billing_error") {}
870
+ export class BetaBillingError extends /*#__PURE__*/S.Struct({
871
+ "type": /*#__PURE__*/BetaBillingErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "billing_error")),
872
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Billing error"))
873
+ }) {}
874
+ export class BetaPermissionErrorType extends /*#__PURE__*/S.Literal("permission_error") {}
875
+ export class BetaPermissionError extends /*#__PURE__*/S.Struct({
876
+ "type": /*#__PURE__*/BetaPermissionErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "permission_error")),
877
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Permission denied"))
878
+ }) {}
879
+ export class BetaNotFoundErrorType extends /*#__PURE__*/S.Literal("not_found_error") {}
880
+ export class BetaNotFoundError extends /*#__PURE__*/S.Struct({
881
+ "type": /*#__PURE__*/BetaNotFoundErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "not_found_error")),
882
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Not found"))
883
+ }) {}
884
+ export class BetaRateLimitErrorType extends /*#__PURE__*/S.Literal("rate_limit_error") {}
885
+ export class BetaRateLimitError extends /*#__PURE__*/S.Struct({
886
+ "type": /*#__PURE__*/BetaRateLimitErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "rate_limit_error")),
887
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Rate limited"))
888
+ }) {}
889
+ export class BetaGatewayTimeoutErrorType extends /*#__PURE__*/S.Literal("timeout_error") {}
890
+ export class BetaGatewayTimeoutError extends /*#__PURE__*/S.Struct({
891
+ "type": /*#__PURE__*/BetaGatewayTimeoutErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "timeout_error")),
892
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Request timeout"))
893
+ }) {}
894
+ export class BetaAPIErrorType extends /*#__PURE__*/S.Literal("api_error") {}
895
+ export class BetaAPIError extends /*#__PURE__*/S.Struct({
896
+ "type": /*#__PURE__*/BetaAPIErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "api_error")),
897
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Internal server error"))
898
+ }) {}
899
+ export class BetaOverloadedErrorType extends /*#__PURE__*/S.Literal("overloaded_error") {}
900
+ export class BetaOverloadedError extends /*#__PURE__*/S.Struct({
901
+ "type": /*#__PURE__*/BetaOverloadedErrorType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "overloaded_error")),
902
+ "message": /*#__PURE__*/S.String.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "Overloaded"))
903
+ }) {}
904
+ export class BetaErrorResponse extends /*#__PURE__*/S.Class("BetaErrorResponse")({
905
+ "type": /*#__PURE__*/BetaErrorResponseType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "error")),
906
+ "error": /*#__PURE__*/S.Union(BetaInvalidRequestError, BetaAuthenticationError, BetaBillingError, BetaPermissionError, BetaNotFoundError, BetaRateLimitError, BetaGatewayTimeoutError, BetaAPIError, BetaOverloadedError)
907
+ }) {}
908
+ export class BetaModelsListParams extends /*#__PURE__*/S.Struct({
909
+ "before_id": /*#__PURE__*/S.optionalWith(S.String, {
910
+ nullable: true
911
+ }),
912
+ "after_id": /*#__PURE__*/S.optionalWith(S.String, {
913
+ nullable: true
914
+ }),
915
+ "limit": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
916
+ nullable: true,
917
+ default: () => 20
918
+ }),
919
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
920
+ nullable: true
921
+ }),
922
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
923
+ nullable: true
924
+ })
925
+ }) {}
926
+ export class BetaModelInfoType extends /*#__PURE__*/S.Literal("model") {}
927
+ export class BetaModelInfo extends /*#__PURE__*/S.Struct({
928
+ "type": /*#__PURE__*/BetaModelInfoType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "model")),
929
+ "id": S.String,
930
+ "display_name": S.String,
931
+ "created_at": S.String
932
+ }) {}
933
+ export class BetaListResponseModelInfo extends /*#__PURE__*/S.Class("BetaListResponseModelInfo")({
934
+ "data": /*#__PURE__*/S.Array(BetaModelInfo),
935
+ "has_more": S.Boolean,
936
+ "first_id": /*#__PURE__*/S.Union(S.String, S.Null),
937
+ "last_id": /*#__PURE__*/S.Union(S.String, S.Null)
938
+ }) {}
939
+ export class BetaModelsGetParams extends /*#__PURE__*/S.Struct({
940
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
941
+ nullable: true
942
+ }),
943
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
944
+ nullable: true
945
+ })
946
+ }) {}
947
+ export class BetaMessageBatchesListParams extends /*#__PURE__*/S.Struct({
948
+ "before_id": /*#__PURE__*/S.optionalWith(S.String, {
949
+ nullable: true
950
+ }),
951
+ "after_id": /*#__PURE__*/S.optionalWith(S.String, {
952
+ nullable: true
953
+ }),
954
+ "limit": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
955
+ nullable: true,
956
+ default: () => 20
957
+ }),
958
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
959
+ nullable: true
960
+ }),
961
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
962
+ nullable: true
963
+ }),
964
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
965
+ nullable: true
966
+ })
967
+ }) {}
968
+ export class BetaMessageBatchType extends /*#__PURE__*/S.Literal("message_batch") {}
969
+ export class BetaMessageBatchProcessingStatus extends /*#__PURE__*/S.Literal("in_progress", "canceling", "ended") {}
970
+ export class BetaRequestCounts extends /*#__PURE__*/S.Struct({
971
+ "processing": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
972
+ "succeeded": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
973
+ "errored": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
974
+ "canceled": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0)),
975
+ "expired": /*#__PURE__*/S.Int.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => 0))
976
+ }) {}
977
+ export class BetaMessageBatch extends /*#__PURE__*/S.Struct({
978
+ "id": S.String,
979
+ "type": /*#__PURE__*/BetaMessageBatchType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message_batch")),
980
+ "processing_status": BetaMessageBatchProcessingStatus,
981
+ "request_counts": BetaRequestCounts,
982
+ "ended_at": /*#__PURE__*/S.Union(S.String, S.Null),
983
+ "created_at": S.String,
984
+ "expires_at": S.String,
985
+ "archived_at": /*#__PURE__*/S.Union(S.String, S.Null),
986
+ "cancel_initiated_at": /*#__PURE__*/S.Union(S.String, S.Null),
987
+ "results_url": /*#__PURE__*/S.Union(S.String, S.Null)
988
+ }) {}
989
+ export class BetaListResponseMessageBatch extends /*#__PURE__*/S.Class("BetaListResponseMessageBatch")({
990
+ "data": /*#__PURE__*/S.Array(BetaMessageBatch),
991
+ "has_more": S.Boolean,
992
+ "first_id": /*#__PURE__*/S.Union(S.String, S.Null),
993
+ "last_id": /*#__PURE__*/S.Union(S.String, S.Null)
994
+ }) {}
995
+ export class BetaMessageBatchesPostParams extends /*#__PURE__*/S.Struct({
996
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
997
+ nullable: true
998
+ }),
999
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
1000
+ nullable: true
1001
+ })
1002
+ }) {}
1003
+ export class BetaMessageBatchIndividualRequestParams extends /*#__PURE__*/S.Struct({
1004
+ "custom_id": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(64), /*#__PURE__*/S.pattern( /*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]{1,64}$"))),
1005
+ "params": BetaCreateMessageParams
1006
+ }) {}
1007
+ export class BetaCreateMessageBatchParams extends /*#__PURE__*/S.Class("BetaCreateMessageBatchParams")({
1008
+ "requests": /*#__PURE__*/S.Array(BetaMessageBatchIndividualRequestParams).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(10000))
1009
+ }) {}
1010
+ export class BetaMessageBatchesRetrieveParams extends /*#__PURE__*/S.Struct({
1011
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
1012
+ nullable: true
1013
+ }),
1014
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
1015
+ nullable: true
1016
+ }),
1017
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
1018
+ nullable: true
1019
+ })
1020
+ }) {}
1021
+ export class BetaMessageBatchesDeleteParams extends /*#__PURE__*/S.Struct({
1022
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
1023
+ nullable: true
1024
+ }),
1025
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
1026
+ nullable: true
1027
+ }),
1028
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
1029
+ nullable: true
1030
+ })
1031
+ }) {}
1032
+ export class BetaDeleteMessageBatchResponseType extends /*#__PURE__*/S.Literal("message_batch_deleted") {}
1033
+ export class BetaDeleteMessageBatchResponse extends /*#__PURE__*/S.Class("BetaDeleteMessageBatchResponse")({
1034
+ "id": S.String,
1035
+ "type": /*#__PURE__*/BetaDeleteMessageBatchResponseType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "message_batch_deleted"))
1036
+ }) {}
1037
+ export class BetaMessageBatchesCancelParams extends /*#__PURE__*/S.Struct({
1038
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
1039
+ nullable: true
1040
+ }),
1041
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
1042
+ nullable: true
1043
+ })
1044
+ }) {}
1045
+ export class BetaMessageBatchesResultsParams extends /*#__PURE__*/S.Struct({
1046
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
1047
+ nullable: true
1048
+ }),
1049
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
1050
+ nullable: true
1051
+ }),
1052
+ "x-api-key": /*#__PURE__*/S.optionalWith(S.String, {
1053
+ nullable: true
1054
+ })
1055
+ }) {}
1056
+ export class BetaMessagesCountTokensPostParams extends /*#__PURE__*/S.Struct({
1057
+ "anthropic-beta": /*#__PURE__*/S.optionalWith(S.String, {
1058
+ nullable: true
1059
+ }),
1060
+ "anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
1061
+ nullable: true
1062
+ })
1063
+ }) {}
1064
+ export class BetaCountMessageTokensParams extends /*#__PURE__*/S.Class("BetaCountMessageTokensParams")({
1065
+ "tool_choice": /*#__PURE__*/S.optionalWith(BetaToolChoice, {
1066
+ nullable: true
1067
+ }),
1068
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022)), {
1069
+ nullable: true
1070
+ }),
1071
+ "messages": /*#__PURE__*/S.Array(BetaInputMessage),
1072
+ "system": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaRequestTextBlock)), {
1073
+ nullable: true
1074
+ }),
1075
+ "model": Model
1076
+ }) {}
1077
+ export class BetaCountMessageTokensResponse extends /*#__PURE__*/S.Class("BetaCountMessageTokensResponse")({
1078
+ "input_tokens": S.Int
1079
+ }) {}
1080
+ export const make = (httpClient, options = {}) => {
1081
+ const unexpectedStatus = (request, response) => Effect.flatMap(Effect.orElseSucceed(response.text, () => "Unexpected status code"), description => Effect.fail(new HttpClientError.ResponseError({
1082
+ request,
1083
+ response,
1084
+ reason: "StatusCode",
1085
+ description
1086
+ })));
1087
+ const applyClientTransform = client => options.transformClient ? options.transformClient(client) : Effect.succeed(client);
1088
+ const decodeError = (response, schema) => Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)(response), Effect.fail);
1089
+ return {
1090
+ "messagesPost": options => HttpClientRequest.make("POST")(`/v1/messages`).pipe(HttpClientRequest.setHeaders({
1091
+ "anthropic-version": options.params["anthropic-version"] ?? undefined
1092
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1093
+ "200": r => HttpClientResponse.schemaBodyJson(Message)(r),
1094
+ "NaN": r => decodeError(r, ErrorResponse),
1095
+ orElse: response => unexpectedStatus(request, response)
1096
+ })))), Effect.scoped),
1097
+ "completePost": options => HttpClientRequest.make("POST")(`/v1/complete`).pipe(HttpClientRequest.setHeaders({
1098
+ "anthropic-version": options.params["anthropic-version"] ?? undefined
1099
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1100
+ "200": r => HttpClientResponse.schemaBodyJson(CompletionResponse)(r),
1101
+ "NaN": r => decodeError(r, ErrorResponse),
1102
+ orElse: response => unexpectedStatus(request, response)
1103
+ })))), Effect.scoped),
1104
+ "modelsList": options => HttpClientRequest.make("GET")(`/v1/models`).pipe(HttpClientRequest.setUrlParams({
1105
+ "before_id": options["before_id"],
1106
+ "after_id": options["after_id"],
1107
+ "limit": options["limit"]
1108
+ }), HttpClientRequest.setHeaders({
1109
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1110
+ "x-api-key": options["x-api-key"] ?? undefined
1111
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1112
+ "200": r => HttpClientResponse.schemaBodyJson(ListResponseModelInfo)(r),
1113
+ "NaN": r => decodeError(r, ErrorResponse),
1114
+ orElse: response => unexpectedStatus(request, response)
1115
+ })))), Effect.scoped),
1116
+ "modelsGet": (modelId, options) => HttpClientRequest.make("GET")(`/v1/models/${modelId}`).pipe(HttpClientRequest.setHeaders({
1117
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1118
+ "x-api-key": options["x-api-key"] ?? undefined
1119
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1120
+ "200": r => HttpClientResponse.schemaBodyJson(ModelInfo)(r),
1121
+ "NaN": r => decodeError(r, ErrorResponse),
1122
+ orElse: response => unexpectedStatus(request, response)
1123
+ })))), Effect.scoped),
1124
+ "messageBatchesList": options => HttpClientRequest.make("GET")(`/v1/messages/batches`).pipe(HttpClientRequest.setUrlParams({
1125
+ "before_id": options["before_id"],
1126
+ "after_id": options["after_id"],
1127
+ "limit": options["limit"]
1128
+ }), HttpClientRequest.setHeaders({
1129
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1130
+ "x-api-key": options["x-api-key"] ?? undefined
1131
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1132
+ "200": r => HttpClientResponse.schemaBodyJson(ListResponseMessageBatch)(r),
1133
+ "NaN": r => decodeError(r, ErrorResponse),
1134
+ orElse: response => unexpectedStatus(request, response)
1135
+ })))), Effect.scoped),
1136
+ "messageBatchesPost": options => HttpClientRequest.make("POST")(`/v1/messages/batches`).pipe(HttpClientRequest.setHeaders({
1137
+ "anthropic-version": options.params["anthropic-version"] ?? undefined
1138
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1139
+ "200": r => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
1140
+ "NaN": r => decodeError(r, ErrorResponse),
1141
+ orElse: response => unexpectedStatus(request, response)
1142
+ })))), Effect.scoped),
1143
+ "messageBatchesRetrieve": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}`).pipe(HttpClientRequest.setHeaders({
1144
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1145
+ "x-api-key": options["x-api-key"] ?? undefined
1146
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1147
+ "200": r => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
1148
+ "NaN": r => decodeError(r, ErrorResponse),
1149
+ orElse: response => unexpectedStatus(request, response)
1150
+ })))), Effect.scoped),
1151
+ "messageBatchesDelete": (messageBatchId, options) => HttpClientRequest.make("DELETE")(`/v1/messages/batches/${messageBatchId}`).pipe(HttpClientRequest.setHeaders({
1152
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1153
+ "x-api-key": options["x-api-key"] ?? undefined
1154
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1155
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteMessageBatchResponse)(r),
1156
+ "NaN": r => decodeError(r, ErrorResponse),
1157
+ orElse: response => unexpectedStatus(request, response)
1158
+ })))), Effect.scoped),
1159
+ "messageBatchesCancel": (messageBatchId, options) => HttpClientRequest.make("POST")(`/v1/messages/batches/${messageBatchId}/cancel`).pipe(HttpClientRequest.setHeaders({
1160
+ "anthropic-version": options["anthropic-version"] ?? undefined
1161
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1162
+ "200": r => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
1163
+ "NaN": r => decodeError(r, ErrorResponse),
1164
+ orElse: response => unexpectedStatus(request, response)
1165
+ })))), Effect.scoped),
1166
+ "messageBatchesResults": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}/results`).pipe(HttpClientRequest.setHeaders({
1167
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1168
+ "x-api-key": options["x-api-key"] ?? undefined
1169
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1170
+ "NaN": r => decodeError(r, ErrorResponse),
1171
+ orElse: response => unexpectedStatus(request, response)
1172
+ })))), Effect.scoped),
1173
+ "messagesCountTokensPost": options => HttpClientRequest.make("POST")(`/v1/messages/count_tokens`).pipe(HttpClientRequest.setHeaders({
1174
+ "anthropic-version": options.params["anthropic-version"] ?? undefined
1175
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1176
+ "200": r => HttpClientResponse.schemaBodyJson(CountMessageTokensResponse)(r),
1177
+ "NaN": r => decodeError(r, ErrorResponse),
1178
+ orElse: response => unexpectedStatus(request, response)
1179
+ })))), Effect.scoped),
1180
+ "betaMessagesPost": options => HttpClientRequest.make("POST")(`/v1/messages?beta=true`).pipe(HttpClientRequest.setHeaders({
1181
+ "anthropic-beta": options.params["anthropic-beta"] ?? undefined,
1182
+ "anthropic-version": options.params["anthropic-version"] ?? undefined
1183
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1184
+ "200": r => HttpClientResponse.schemaBodyJson(BetaMessage)(r),
1185
+ "NaN": r => decodeError(r, BetaErrorResponse),
1186
+ orElse: response => unexpectedStatus(request, response)
1187
+ })))), Effect.scoped),
1188
+ "betaModelsList": options => HttpClientRequest.make("GET")(`/v1/models?beta=true`).pipe(HttpClientRequest.setUrlParams({
1189
+ "before_id": options["before_id"],
1190
+ "after_id": options["after_id"],
1191
+ "limit": options["limit"]
1192
+ }), HttpClientRequest.setHeaders({
1193
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1194
+ "x-api-key": options["x-api-key"] ?? undefined
1195
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1196
+ "200": r => HttpClientResponse.schemaBodyJson(BetaListResponseModelInfo)(r),
1197
+ "NaN": r => decodeError(r, BetaErrorResponse),
1198
+ orElse: response => unexpectedStatus(request, response)
1199
+ })))), Effect.scoped),
1200
+ "betaModelsGet": (modelId, options) => HttpClientRequest.make("GET")(`/v1/models/${modelId}?beta=true`).pipe(HttpClientRequest.setHeaders({
1201
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1202
+ "x-api-key": options["x-api-key"] ?? undefined
1203
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1204
+ "200": r => HttpClientResponse.schemaBodyJson(BetaModelInfo)(r),
1205
+ "NaN": r => decodeError(r, BetaErrorResponse),
1206
+ orElse: response => unexpectedStatus(request, response)
1207
+ })))), Effect.scoped),
1208
+ "betaMessageBatchesList": options => HttpClientRequest.make("GET")(`/v1/messages/batches?beta=true`).pipe(HttpClientRequest.setUrlParams({
1209
+ "before_id": options["before_id"],
1210
+ "after_id": options["after_id"],
1211
+ "limit": options["limit"]
1212
+ }), HttpClientRequest.setHeaders({
1213
+ "anthropic-beta": options["anthropic-beta"] ?? undefined,
1214
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1215
+ "x-api-key": options["x-api-key"] ?? undefined
1216
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1217
+ "200": r => HttpClientResponse.schemaBodyJson(BetaListResponseMessageBatch)(r),
1218
+ "NaN": r => decodeError(r, BetaErrorResponse),
1219
+ orElse: response => unexpectedStatus(request, response)
1220
+ })))), Effect.scoped),
1221
+ "betaMessageBatchesPost": options => HttpClientRequest.make("POST")(`/v1/messages/batches?beta=true`).pipe(HttpClientRequest.setHeaders({
1222
+ "anthropic-beta": options.params["anthropic-beta"] ?? undefined,
1223
+ "anthropic-version": options.params["anthropic-version"] ?? undefined
1224
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1225
+ "200": r => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
1226
+ "NaN": r => decodeError(r, BetaErrorResponse),
1227
+ orElse: response => unexpectedStatus(request, response)
1228
+ })))), Effect.scoped),
1229
+ "betaMessageBatchesRetrieve": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}?beta=true`).pipe(HttpClientRequest.setHeaders({
1230
+ "anthropic-beta": options["anthropic-beta"] ?? undefined,
1231
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1232
+ "x-api-key": options["x-api-key"] ?? undefined
1233
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1234
+ "200": r => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
1235
+ "NaN": r => decodeError(r, BetaErrorResponse),
1236
+ orElse: response => unexpectedStatus(request, response)
1237
+ })))), Effect.scoped),
1238
+ "betaMessageBatchesDelete": (messageBatchId, options) => HttpClientRequest.make("DELETE")(`/v1/messages/batches/${messageBatchId}?beta=true`).pipe(HttpClientRequest.setHeaders({
1239
+ "anthropic-beta": options["anthropic-beta"] ?? undefined,
1240
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1241
+ "x-api-key": options["x-api-key"] ?? undefined
1242
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1243
+ "200": r => HttpClientResponse.schemaBodyJson(BetaDeleteMessageBatchResponse)(r),
1244
+ "NaN": r => decodeError(r, BetaErrorResponse),
1245
+ orElse: response => unexpectedStatus(request, response)
1246
+ })))), Effect.scoped),
1247
+ "betaMessageBatchesCancel": (messageBatchId, options) => HttpClientRequest.make("POST")(`/v1/messages/batches/${messageBatchId}/cancel?beta=true`).pipe(HttpClientRequest.setHeaders({
1248
+ "anthropic-beta": options["anthropic-beta"] ?? undefined,
1249
+ "anthropic-version": options["anthropic-version"] ?? undefined
1250
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1251
+ "200": r => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
1252
+ "NaN": r => decodeError(r, BetaErrorResponse),
1253
+ orElse: response => unexpectedStatus(request, response)
1254
+ })))), Effect.scoped),
1255
+ "betaMessageBatchesResults": (messageBatchId, options) => HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}/results?beta=true`).pipe(HttpClientRequest.setHeaders({
1256
+ "anthropic-beta": options["anthropic-beta"] ?? undefined,
1257
+ "anthropic-version": options["anthropic-version"] ?? undefined,
1258
+ "x-api-key": options["x-api-key"] ?? undefined
1259
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1260
+ "NaN": r => decodeError(r, BetaErrorResponse),
1261
+ orElse: response => unexpectedStatus(request, response)
1262
+ })))), Effect.scoped),
1263
+ "betaMessagesCountTokensPost": options => HttpClientRequest.make("POST")(`/v1/messages/count_tokens?beta=true`).pipe(HttpClientRequest.setHeaders({
1264
+ "anthropic-beta": options.params["anthropic-beta"] ?? undefined,
1265
+ "anthropic-version": options.params["anthropic-version"] ?? undefined
1266
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(applyClientTransform(httpClient), httpClient => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
1267
+ "200": r => HttpClientResponse.schemaBodyJson(BetaCountMessageTokensResponse)(r),
1268
+ "NaN": r => decodeError(r, BetaErrorResponse),
1269
+ orElse: response => unexpectedStatus(request, response)
1270
+ })))), Effect.scoped)
1271
+ };
1272
+ };
1273
+ //# sourceMappingURL=Generated.js.map