@effect/ai-anthropic 0.2.2 → 0.2.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/AnthropicCompletions.js +21 -6
- package/dist/cjs/AnthropicCompletions.js.map +1 -1
- package/dist/cjs/Generated.js +269 -64
- package/dist/cjs/Generated.js.map +1 -1
- package/dist/dts/AnthropicCompletions.d.ts +1 -1
- package/dist/dts/AnthropicCompletions.d.ts.map +1 -1
- package/dist/dts/Generated.d.ts +495 -34
- package/dist/dts/Generated.d.ts.map +1 -1
- package/dist/esm/AnthropicCompletions.js +21 -6
- package/dist/esm/AnthropicCompletions.js.map +1 -1
- package/dist/esm/Generated.js +213 -60
- package/dist/esm/Generated.js.map +1 -1
- package/package.json +5 -5
- package/src/AnthropicCompletions.ts +20 -11
- package/src/Generated.ts +311 -104
package/src/Generated.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type * as HttpClient from "@effect/platform/HttpClient"
|
|
|
5
5
|
import * as HttpClientError from "@effect/platform/HttpClientError"
|
|
6
6
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest"
|
|
7
7
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse"
|
|
8
|
+
import type * as UrlParams from "@effect/platform/UrlParams"
|
|
8
9
|
import * as Effect from "effect/Effect"
|
|
9
10
|
import type { ParseError } from "effect/ParseResult"
|
|
10
11
|
import * as S from "effect/Schema"
|
|
@@ -13,21 +14,22 @@ export class MessagesPostParams extends S.Struct({
|
|
|
13
14
|
"anthropic-version": S.optionalWith(S.String, { nullable: true })
|
|
14
15
|
}) {}
|
|
15
16
|
|
|
16
|
-
export class
|
|
17
|
-
"claude-3-7-sonnet-latest",
|
|
18
|
-
"claude-3-7-sonnet-20250219",
|
|
19
|
-
"claude-3-5-
|
|
20
|
-
"claude-3-5-
|
|
21
|
-
"claude-3-5-sonnet-
|
|
22
|
-
"claude-3-5-
|
|
23
|
-
"claude-3-5-
|
|
24
|
-
"claude-3-
|
|
25
|
-
"claude-3-opus-
|
|
26
|
-
"claude-3-
|
|
17
|
+
export class Model extends S.Union(
|
|
18
|
+
S.Literal("claude-3-7-sonnet-latest"),
|
|
19
|
+
S.Literal("claude-3-7-sonnet-20250219"),
|
|
20
|
+
S.Literal("claude-3-5-haiku-latest"),
|
|
21
|
+
S.Literal("claude-3-5-haiku-20241022"),
|
|
22
|
+
S.Literal("claude-3-5-sonnet-latest"),
|
|
23
|
+
S.Literal("claude-3-5-sonnet-20241022"),
|
|
24
|
+
S.Literal("claude-3-5-sonnet-20240620"),
|
|
25
|
+
S.Literal("claude-3-opus-latest"),
|
|
26
|
+
S.Literal("claude-3-opus-20240229"),
|
|
27
|
+
S.Literal("claude-3-sonnet-20240229"),
|
|
28
|
+
S.Literal("claude-3-haiku-20240307"),
|
|
29
|
+
S.Literal("claude-2.1"),
|
|
30
|
+
S.Literal("claude-2.0")
|
|
27
31
|
) {}
|
|
28
32
|
|
|
29
|
-
export class Model extends S.Union(S.String, ModelEnum) {}
|
|
30
|
-
|
|
31
33
|
export class InputMessageRole extends S.Literal("user", "assistant") {}
|
|
32
34
|
|
|
33
35
|
export class CacheControlEphemeralType extends S.Literal("ephemeral") {}
|
|
@@ -96,10 +98,17 @@ export class Base64ImageSource extends S.Struct({
|
|
|
96
98
|
"data": S.String
|
|
97
99
|
}) {}
|
|
98
100
|
|
|
101
|
+
export class URLImageSourceType extends S.Literal("url") {}
|
|
102
|
+
|
|
103
|
+
export class URLImageSource extends S.Struct({
|
|
104
|
+
"type": URLImageSourceType,
|
|
105
|
+
"url": S.String
|
|
106
|
+
}) {}
|
|
107
|
+
|
|
99
108
|
export class RequestImageBlock extends S.Struct({
|
|
100
109
|
"cache_control": S.optionalWith(S.Union(CacheControlEphemeral, S.Null), { nullable: true }),
|
|
101
110
|
"type": RequestImageBlockType,
|
|
102
|
-
"source": Base64ImageSource
|
|
111
|
+
"source": S.Union(Base64ImageSource, URLImageSource)
|
|
103
112
|
}) {}
|
|
104
113
|
|
|
105
114
|
export class RequestToolUseBlockType extends S.Literal("tool_use") {}
|
|
@@ -153,6 +162,13 @@ export class ContentBlockSource extends S.Struct({
|
|
|
153
162
|
"content": S.Union(S.String, S.Array(S.Union(RequestTextBlock, RequestImageBlock)))
|
|
154
163
|
}) {}
|
|
155
164
|
|
|
165
|
+
export class URLPDFSourceType extends S.Literal("url") {}
|
|
166
|
+
|
|
167
|
+
export class URLPDFSource extends S.Struct({
|
|
168
|
+
"type": URLPDFSourceType,
|
|
169
|
+
"url": S.String
|
|
170
|
+
}) {}
|
|
171
|
+
|
|
156
172
|
export class RequestCitationsConfig extends S.Struct({
|
|
157
173
|
"enabled": S.optionalWith(S.Boolean, { nullable: true })
|
|
158
174
|
}) {}
|
|
@@ -160,18 +176,35 @@ export class RequestCitationsConfig extends S.Struct({
|
|
|
160
176
|
export class RequestDocumentBlock extends S.Struct({
|
|
161
177
|
"cache_control": S.optionalWith(S.Union(CacheControlEphemeral, S.Null), { nullable: true }),
|
|
162
178
|
"type": RequestDocumentBlockType,
|
|
163
|
-
"source": S.Union(Base64PDFSource, PlainTextSource, ContentBlockSource),
|
|
164
|
-
"title": S.optionalWith(S.Union(S.String.pipe(S.minLength(1), S.maxLength(
|
|
179
|
+
"source": S.Union(Base64PDFSource, PlainTextSource, ContentBlockSource, URLPDFSource),
|
|
180
|
+
"title": S.optionalWith(S.Union(S.String.pipe(S.minLength(1), S.maxLength(500)), S.Null), { nullable: true }),
|
|
165
181
|
"context": S.optionalWith(S.Union(S.String.pipe(S.minLength(1)), S.Null), { nullable: true }),
|
|
166
182
|
"citations": S.optionalWith(RequestCitationsConfig, { nullable: true })
|
|
167
183
|
}) {}
|
|
168
184
|
|
|
185
|
+
export class RequestThinkingBlockType extends S.Literal("thinking") {}
|
|
186
|
+
|
|
187
|
+
export class RequestThinkingBlock extends S.Struct({
|
|
188
|
+
"type": RequestThinkingBlockType,
|
|
189
|
+
"thinking": S.String,
|
|
190
|
+
"signature": S.String
|
|
191
|
+
}) {}
|
|
192
|
+
|
|
193
|
+
export class RequestRedactedThinkingBlockType extends S.Literal("redacted_thinking") {}
|
|
194
|
+
|
|
195
|
+
export class RequestRedactedThinkingBlock extends S.Struct({
|
|
196
|
+
"type": RequestRedactedThinkingBlockType,
|
|
197
|
+
"data": S.String
|
|
198
|
+
}) {}
|
|
199
|
+
|
|
169
200
|
export class InputContentBlock extends S.Union(
|
|
170
201
|
RequestTextBlock,
|
|
171
202
|
RequestImageBlock,
|
|
172
203
|
RequestToolUseBlock,
|
|
173
204
|
RequestToolResultBlock,
|
|
174
|
-
RequestDocumentBlock
|
|
205
|
+
RequestDocumentBlock,
|
|
206
|
+
RequestThinkingBlock,
|
|
207
|
+
RequestRedactedThinkingBlock
|
|
175
208
|
) {}
|
|
176
209
|
|
|
177
210
|
export class InputMessage extends S.Struct({
|
|
@@ -183,6 +216,21 @@ export class Metadata extends S.Struct({
|
|
|
183
216
|
"user_id": S.optionalWith(S.Union(S.String.pipe(S.maxLength(256)), S.Null), { nullable: true })
|
|
184
217
|
}) {}
|
|
185
218
|
|
|
219
|
+
export class ThinkingConfigEnabledType extends S.Literal("enabled") {}
|
|
220
|
+
|
|
221
|
+
export class ThinkingConfigEnabled extends S.Struct({
|
|
222
|
+
"type": ThinkingConfigEnabledType,
|
|
223
|
+
"budget_tokens": S.Int.pipe(S.greaterThanOrEqualTo(1024))
|
|
224
|
+
}) {}
|
|
225
|
+
|
|
226
|
+
export class ThinkingConfigDisabledType extends S.Literal("disabled") {}
|
|
227
|
+
|
|
228
|
+
export class ThinkingConfigDisabled extends S.Struct({
|
|
229
|
+
"type": ThinkingConfigDisabledType
|
|
230
|
+
}) {}
|
|
231
|
+
|
|
232
|
+
export class ThinkingConfigParam extends S.Union(ThinkingConfigEnabled, ThinkingConfigDisabled) {}
|
|
233
|
+
|
|
186
234
|
export class ToolChoiceAutoType extends S.Literal("auto") {}
|
|
187
235
|
|
|
188
236
|
export class ToolChoiceAuto extends S.Struct({
|
|
@@ -205,7 +253,13 @@ export class ToolChoiceTool extends S.Struct({
|
|
|
205
253
|
"disable_parallel_tool_use": S.optionalWith(S.Boolean, { nullable: true })
|
|
206
254
|
}) {}
|
|
207
255
|
|
|
208
|
-
export class
|
|
256
|
+
export class ToolChoiceNoneType extends S.Literal("none") {}
|
|
257
|
+
|
|
258
|
+
export class ToolChoiceNone extends S.Struct({
|
|
259
|
+
"type": ToolChoiceNoneType
|
|
260
|
+
}) {}
|
|
261
|
+
|
|
262
|
+
export class ToolChoice extends S.Union(ToolChoiceAuto, ToolChoiceAny, ToolChoiceTool, ToolChoiceNone) {}
|
|
209
263
|
|
|
210
264
|
export class InputSchemaType extends S.Literal("object") {}
|
|
211
265
|
|
|
@@ -221,6 +275,26 @@ export class Tool extends S.Struct({
|
|
|
221
275
|
"cache_control": S.optionalWith(S.Union(CacheControlEphemeral, S.Null), { nullable: true })
|
|
222
276
|
}) {}
|
|
223
277
|
|
|
278
|
+
export class BashTool20250124Type extends S.Literal("bash_20250124") {}
|
|
279
|
+
|
|
280
|
+
export class BashTool20250124Name extends S.Literal("bash") {}
|
|
281
|
+
|
|
282
|
+
export class BashTool20250124 extends S.Struct({
|
|
283
|
+
"cache_control": S.optionalWith(S.Union(CacheControlEphemeral, S.Null), { nullable: true }),
|
|
284
|
+
"type": BashTool20250124Type,
|
|
285
|
+
"name": BashTool20250124Name
|
|
286
|
+
}) {}
|
|
287
|
+
|
|
288
|
+
export class TextEditor20250124Type extends S.Literal("text_editor_20250124") {}
|
|
289
|
+
|
|
290
|
+
export class TextEditor20250124Name extends S.Literal("str_replace_editor") {}
|
|
291
|
+
|
|
292
|
+
export class TextEditor20250124 extends S.Struct({
|
|
293
|
+
"cache_control": S.optionalWith(S.Union(CacheControlEphemeral, S.Null), { nullable: true }),
|
|
294
|
+
"type": TextEditor20250124Type,
|
|
295
|
+
"name": TextEditor20250124Name
|
|
296
|
+
}) {}
|
|
297
|
+
|
|
224
298
|
export class CreateMessageParams extends S.Class<CreateMessageParams>("CreateMessageParams")({
|
|
225
299
|
"model": Model,
|
|
226
300
|
"messages": S.Array(InputMessage),
|
|
@@ -230,8 +304,9 @@ export class CreateMessageParams extends S.Class<CreateMessageParams>("CreateMes
|
|
|
230
304
|
"stream": S.optionalWith(S.Boolean, { nullable: true }),
|
|
231
305
|
"system": S.optionalWith(S.Union(S.String, S.Array(RequestTextBlock)), { nullable: true }),
|
|
232
306
|
"temperature": S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), { nullable: true }),
|
|
307
|
+
"thinking": S.optionalWith(ThinkingConfigParam, { nullable: true }),
|
|
233
308
|
"tool_choice": S.optionalWith(ToolChoice, { nullable: true }),
|
|
234
|
-
"tools": S.optionalWith(S.Array(Tool), { nullable: true }),
|
|
309
|
+
"tools": S.optionalWith(S.Array(S.Union(Tool, BashTool20250124, TextEditor20250124)), { nullable: true }),
|
|
235
310
|
"top_k": S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
|
|
236
311
|
"top_p": S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), { nullable: true })
|
|
237
312
|
}) {}
|
|
@@ -309,7 +384,27 @@ export class ResponseToolUseBlock extends S.Struct({
|
|
|
309
384
|
"input": S.Record({ key: S.String, value: S.Unknown })
|
|
310
385
|
}) {}
|
|
311
386
|
|
|
312
|
-
export class
|
|
387
|
+
export class ResponseThinkingBlockType extends S.Literal("thinking") {}
|
|
388
|
+
|
|
389
|
+
export class ResponseThinkingBlock extends S.Struct({
|
|
390
|
+
"type": ResponseThinkingBlockType.pipe(S.propertySignature, S.withConstructorDefault(() => "thinking" as const)),
|
|
391
|
+
"thinking": S.String,
|
|
392
|
+
"signature": S.String
|
|
393
|
+
}) {}
|
|
394
|
+
|
|
395
|
+
export class ResponseRedactedThinkingBlockType extends S.Literal("redacted_thinking") {}
|
|
396
|
+
|
|
397
|
+
export class ResponseRedactedThinkingBlock extends S.Struct({
|
|
398
|
+
"type": ResponseRedactedThinkingBlockType.pipe(
|
|
399
|
+
S.propertySignature,
|
|
400
|
+
S.withConstructorDefault(() => "redacted_thinking" as const)
|
|
401
|
+
),
|
|
402
|
+
"data": S.String
|
|
403
|
+
}) {}
|
|
404
|
+
|
|
405
|
+
export class ContentBlock
|
|
406
|
+
extends S.Union(ResponseTextBlock, ResponseToolUseBlock, ResponseThinkingBlock, ResponseRedactedThinkingBlock)
|
|
407
|
+
{}
|
|
313
408
|
|
|
314
409
|
export class MessageStopReasonEnum extends S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use") {}
|
|
315
410
|
|
|
@@ -570,9 +665,10 @@ export class MessagesCountTokensPostParams extends S.Struct({
|
|
|
570
665
|
|
|
571
666
|
export class CountMessageTokensParams extends S.Class<CountMessageTokensParams>("CountMessageTokensParams")({
|
|
572
667
|
"tool_choice": S.optionalWith(ToolChoice, { nullable: true }),
|
|
573
|
-
"tools": S.optionalWith(S.Array(Tool), { nullable: true }),
|
|
668
|
+
"tools": S.optionalWith(S.Array(S.Union(Tool, BashTool20250124, TextEditor20250124)), { nullable: true }),
|
|
574
669
|
"messages": S.Array(InputMessage),
|
|
575
670
|
"system": S.optionalWith(S.Union(S.String, S.Array(RequestTextBlock)), { nullable: true }),
|
|
671
|
+
"thinking": S.optionalWith(ThinkingConfigParam, { nullable: true }),
|
|
576
672
|
"model": Model
|
|
577
673
|
}) {}
|
|
578
674
|
|
|
@@ -659,10 +755,17 @@ export class BetaBase64ImageSource extends S.Struct({
|
|
|
659
755
|
"data": S.String
|
|
660
756
|
}) {}
|
|
661
757
|
|
|
758
|
+
export class BetaURLImageSourceType extends S.Literal("url") {}
|
|
759
|
+
|
|
760
|
+
export class BetaURLImageSource extends S.Struct({
|
|
761
|
+
"type": BetaURLImageSourceType,
|
|
762
|
+
"url": S.String
|
|
763
|
+
}) {}
|
|
764
|
+
|
|
662
765
|
export class BetaRequestImageBlock extends S.Struct({
|
|
663
766
|
"cache_control": S.optionalWith(S.Union(BetaCacheControlEphemeral, S.Null), { nullable: true }),
|
|
664
767
|
"type": BetaRequestImageBlockType,
|
|
665
|
-
"source": BetaBase64ImageSource
|
|
768
|
+
"source": S.Union(BetaBase64ImageSource, BetaURLImageSource)
|
|
666
769
|
}) {}
|
|
667
770
|
|
|
668
771
|
export class BetaRequestToolUseBlockType extends S.Literal("tool_use") {}
|
|
@@ -716,6 +819,13 @@ export class BetaContentBlockSource extends S.Struct({
|
|
|
716
819
|
"content": S.Union(S.String, S.Array(S.Union(BetaRequestTextBlock, BetaRequestImageBlock)))
|
|
717
820
|
}) {}
|
|
718
821
|
|
|
822
|
+
export class BetaURLPDFSourceType extends S.Literal("url") {}
|
|
823
|
+
|
|
824
|
+
export class BetaURLPDFSource extends S.Struct({
|
|
825
|
+
"type": BetaURLPDFSourceType,
|
|
826
|
+
"url": S.String
|
|
827
|
+
}) {}
|
|
828
|
+
|
|
719
829
|
export class BetaRequestCitationsConfig extends S.Struct({
|
|
720
830
|
"enabled": S.optionalWith(S.Boolean, { nullable: true })
|
|
721
831
|
}) {}
|
|
@@ -723,18 +833,35 @@ export class BetaRequestCitationsConfig extends S.Struct({
|
|
|
723
833
|
export class BetaRequestDocumentBlock extends S.Struct({
|
|
724
834
|
"cache_control": S.optionalWith(S.Union(BetaCacheControlEphemeral, S.Null), { nullable: true }),
|
|
725
835
|
"type": BetaRequestDocumentBlockType,
|
|
726
|
-
"source": S.Union(BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource),
|
|
727
|
-
"title": S.optionalWith(S.Union(S.String.pipe(S.minLength(1), S.maxLength(
|
|
836
|
+
"source": S.Union(BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource, BetaURLPDFSource),
|
|
837
|
+
"title": S.optionalWith(S.Union(S.String.pipe(S.minLength(1), S.maxLength(500)), S.Null), { nullable: true }),
|
|
728
838
|
"context": S.optionalWith(S.Union(S.String.pipe(S.minLength(1)), S.Null), { nullable: true }),
|
|
729
839
|
"citations": S.optionalWith(BetaRequestCitationsConfig, { nullable: true })
|
|
730
840
|
}) {}
|
|
731
841
|
|
|
842
|
+
export class BetaRequestThinkingBlockType extends S.Literal("thinking") {}
|
|
843
|
+
|
|
844
|
+
export class BetaRequestThinkingBlock extends S.Struct({
|
|
845
|
+
"type": BetaRequestThinkingBlockType,
|
|
846
|
+
"thinking": S.String,
|
|
847
|
+
"signature": S.String
|
|
848
|
+
}) {}
|
|
849
|
+
|
|
850
|
+
export class BetaRequestRedactedThinkingBlockType extends S.Literal("redacted_thinking") {}
|
|
851
|
+
|
|
852
|
+
export class BetaRequestRedactedThinkingBlock extends S.Struct({
|
|
853
|
+
"type": BetaRequestRedactedThinkingBlockType,
|
|
854
|
+
"data": S.String
|
|
855
|
+
}) {}
|
|
856
|
+
|
|
732
857
|
export class BetaInputContentBlock extends S.Union(
|
|
733
858
|
BetaRequestTextBlock,
|
|
734
859
|
BetaRequestImageBlock,
|
|
735
860
|
BetaRequestToolUseBlock,
|
|
736
861
|
BetaRequestToolResultBlock,
|
|
737
|
-
BetaRequestDocumentBlock
|
|
862
|
+
BetaRequestDocumentBlock,
|
|
863
|
+
BetaRequestThinkingBlock,
|
|
864
|
+
BetaRequestRedactedThinkingBlock
|
|
738
865
|
) {}
|
|
739
866
|
|
|
740
867
|
export class BetaInputMessage extends S.Struct({
|
|
@@ -746,6 +873,21 @@ export class BetaMetadata extends S.Struct({
|
|
|
746
873
|
"user_id": S.optionalWith(S.Union(S.String.pipe(S.maxLength(256)), S.Null), { nullable: true })
|
|
747
874
|
}) {}
|
|
748
875
|
|
|
876
|
+
export class BetaThinkingConfigEnabledType extends S.Literal("enabled") {}
|
|
877
|
+
|
|
878
|
+
export class BetaThinkingConfigEnabled extends S.Struct({
|
|
879
|
+
"type": BetaThinkingConfigEnabledType,
|
|
880
|
+
"budget_tokens": S.Int.pipe(S.greaterThanOrEqualTo(1024))
|
|
881
|
+
}) {}
|
|
882
|
+
|
|
883
|
+
export class BetaThinkingConfigDisabledType extends S.Literal("disabled") {}
|
|
884
|
+
|
|
885
|
+
export class BetaThinkingConfigDisabled extends S.Struct({
|
|
886
|
+
"type": BetaThinkingConfigDisabledType
|
|
887
|
+
}) {}
|
|
888
|
+
|
|
889
|
+
export class BetaThinkingConfigParam extends S.Union(BetaThinkingConfigEnabled, BetaThinkingConfigDisabled) {}
|
|
890
|
+
|
|
749
891
|
export class BetaToolChoiceAutoType extends S.Literal("auto") {}
|
|
750
892
|
|
|
751
893
|
export class BetaToolChoiceAuto extends S.Struct({
|
|
@@ -768,7 +910,15 @@ export class BetaToolChoiceTool extends S.Struct({
|
|
|
768
910
|
"disable_parallel_tool_use": S.optionalWith(S.Boolean, { nullable: true })
|
|
769
911
|
}) {}
|
|
770
912
|
|
|
771
|
-
export class
|
|
913
|
+
export class BetaToolChoiceNoneType extends S.Literal("none") {}
|
|
914
|
+
|
|
915
|
+
export class BetaToolChoiceNone extends S.Struct({
|
|
916
|
+
"type": BetaToolChoiceNoneType
|
|
917
|
+
}) {}
|
|
918
|
+
|
|
919
|
+
export class BetaToolChoice
|
|
920
|
+
extends S.Union(BetaToolChoiceAuto, BetaToolChoiceAny, BetaToolChoiceTool, BetaToolChoiceNone)
|
|
921
|
+
{}
|
|
772
922
|
|
|
773
923
|
export class BetaToolTypeEnum extends S.Literal("custom") {}
|
|
774
924
|
|
|
@@ -820,6 +970,39 @@ export class BetaTextEditor20241022 extends S.Struct({
|
|
|
820
970
|
"name": BetaTextEditor20241022Name
|
|
821
971
|
}) {}
|
|
822
972
|
|
|
973
|
+
export class BetaComputerUseTool20250124Type extends S.Literal("computer_20250124") {}
|
|
974
|
+
|
|
975
|
+
export class BetaComputerUseTool20250124Name extends S.Literal("computer") {}
|
|
976
|
+
|
|
977
|
+
export class BetaComputerUseTool20250124 extends S.Struct({
|
|
978
|
+
"cache_control": S.optionalWith(S.Union(BetaCacheControlEphemeral, S.Null), { nullable: true }),
|
|
979
|
+
"type": BetaComputerUseTool20250124Type,
|
|
980
|
+
"name": BetaComputerUseTool20250124Name,
|
|
981
|
+
"display_height_px": S.Int.pipe(S.greaterThanOrEqualTo(1)),
|
|
982
|
+
"display_width_px": S.Int.pipe(S.greaterThanOrEqualTo(1)),
|
|
983
|
+
"display_number": S.optionalWith(S.Union(S.Int.pipe(S.greaterThanOrEqualTo(0)), S.Null), { nullable: true })
|
|
984
|
+
}) {}
|
|
985
|
+
|
|
986
|
+
export class BetaBashTool20250124Type extends S.Literal("bash_20250124") {}
|
|
987
|
+
|
|
988
|
+
export class BetaBashTool20250124Name extends S.Literal("bash") {}
|
|
989
|
+
|
|
990
|
+
export class BetaBashTool20250124 extends S.Struct({
|
|
991
|
+
"cache_control": S.optionalWith(S.Union(BetaCacheControlEphemeral, S.Null), { nullable: true }),
|
|
992
|
+
"type": BetaBashTool20250124Type,
|
|
993
|
+
"name": BetaBashTool20250124Name
|
|
994
|
+
}) {}
|
|
995
|
+
|
|
996
|
+
export class BetaTextEditor20250124Type extends S.Literal("text_editor_20250124") {}
|
|
997
|
+
|
|
998
|
+
export class BetaTextEditor20250124Name extends S.Literal("str_replace_editor") {}
|
|
999
|
+
|
|
1000
|
+
export class BetaTextEditor20250124 extends S.Struct({
|
|
1001
|
+
"cache_control": S.optionalWith(S.Union(BetaCacheControlEphemeral, S.Null), { nullable: true }),
|
|
1002
|
+
"type": BetaTextEditor20250124Type,
|
|
1003
|
+
"name": BetaTextEditor20250124Name
|
|
1004
|
+
}) {}
|
|
1005
|
+
|
|
823
1006
|
export class BetaCreateMessageParams extends S.Class<BetaCreateMessageParams>("BetaCreateMessageParams")({
|
|
824
1007
|
"model": Model,
|
|
825
1008
|
"messages": S.Array(BetaInputMessage),
|
|
@@ -829,9 +1012,20 @@ export class BetaCreateMessageParams extends S.Class<BetaCreateMessageParams>("B
|
|
|
829
1012
|
"stream": S.optionalWith(S.Boolean, { nullable: true }),
|
|
830
1013
|
"system": S.optionalWith(S.Union(S.String, S.Array(BetaRequestTextBlock)), { nullable: true }),
|
|
831
1014
|
"temperature": S.optionalWith(S.Number.pipe(S.greaterThanOrEqualTo(0), S.lessThanOrEqualTo(1)), { nullable: true }),
|
|
1015
|
+
"thinking": S.optionalWith(BetaThinkingConfigParam, { nullable: true }),
|
|
832
1016
|
"tool_choice": S.optionalWith(BetaToolChoice, { nullable: true }),
|
|
833
1017
|
"tools": S.optionalWith(
|
|
834
|
-
S.Array(
|
|
1018
|
+
S.Array(
|
|
1019
|
+
S.Union(
|
|
1020
|
+
BetaTool,
|
|
1021
|
+
BetaComputerUseTool20241022,
|
|
1022
|
+
BetaBashTool20241022,
|
|
1023
|
+
BetaTextEditor20241022,
|
|
1024
|
+
BetaComputerUseTool20250124,
|
|
1025
|
+
BetaBashTool20250124,
|
|
1026
|
+
BetaTextEditor20250124
|
|
1027
|
+
)
|
|
1028
|
+
),
|
|
835
1029
|
{ nullable: true }
|
|
836
1030
|
),
|
|
837
1031
|
"top_k": S.optionalWith(S.Int.pipe(S.greaterThanOrEqualTo(0)), { nullable: true }),
|
|
@@ -915,7 +1109,30 @@ export class BetaResponseToolUseBlock extends S.Struct({
|
|
|
915
1109
|
"input": S.Record({ key: S.String, value: S.Unknown })
|
|
916
1110
|
}) {}
|
|
917
1111
|
|
|
918
|
-
export class
|
|
1112
|
+
export class BetaResponseThinkingBlockType extends S.Literal("thinking") {}
|
|
1113
|
+
|
|
1114
|
+
export class BetaResponseThinkingBlock extends S.Struct({
|
|
1115
|
+
"type": BetaResponseThinkingBlockType.pipe(S.propertySignature, S.withConstructorDefault(() => "thinking" as const)),
|
|
1116
|
+
"thinking": S.String,
|
|
1117
|
+
"signature": S.String
|
|
1118
|
+
}) {}
|
|
1119
|
+
|
|
1120
|
+
export class BetaResponseRedactedThinkingBlockType extends S.Literal("redacted_thinking") {}
|
|
1121
|
+
|
|
1122
|
+
export class BetaResponseRedactedThinkingBlock extends S.Struct({
|
|
1123
|
+
"type": BetaResponseRedactedThinkingBlockType.pipe(
|
|
1124
|
+
S.propertySignature,
|
|
1125
|
+
S.withConstructorDefault(() => "redacted_thinking" as const)
|
|
1126
|
+
),
|
|
1127
|
+
"data": S.String
|
|
1128
|
+
}) {}
|
|
1129
|
+
|
|
1130
|
+
export class BetaContentBlock extends S.Union(
|
|
1131
|
+
BetaResponseTextBlock,
|
|
1132
|
+
BetaResponseToolUseBlock,
|
|
1133
|
+
BetaResponseThinkingBlock,
|
|
1134
|
+
BetaResponseRedactedThinkingBlock
|
|
1135
|
+
) {}
|
|
919
1136
|
|
|
920
1137
|
export class BetaMessageStopReasonEnum extends S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use") {}
|
|
921
1138
|
|
|
@@ -1174,11 +1391,22 @@ export class BetaCountMessageTokensParams
|
|
|
1174
1391
|
extends S.Class<BetaCountMessageTokensParams>("BetaCountMessageTokensParams")({
|
|
1175
1392
|
"tool_choice": S.optionalWith(BetaToolChoice, { nullable: true }),
|
|
1176
1393
|
"tools": S.optionalWith(
|
|
1177
|
-
S.Array(
|
|
1394
|
+
S.Array(
|
|
1395
|
+
S.Union(
|
|
1396
|
+
BetaTool,
|
|
1397
|
+
BetaComputerUseTool20241022,
|
|
1398
|
+
BetaBashTool20241022,
|
|
1399
|
+
BetaTextEditor20241022,
|
|
1400
|
+
BetaComputerUseTool20250124,
|
|
1401
|
+
BetaBashTool20250124,
|
|
1402
|
+
BetaTextEditor20250124
|
|
1403
|
+
)
|
|
1404
|
+
),
|
|
1178
1405
|
{ nullable: true }
|
|
1179
1406
|
),
|
|
1180
1407
|
"messages": S.Array(BetaInputMessage),
|
|
1181
1408
|
"system": S.optionalWith(S.Union(S.String, S.Array(BetaRequestTextBlock)), { nullable: true }),
|
|
1409
|
+
"thinking": S.optionalWith(BetaThinkingConfigParam, { nullable: true }),
|
|
1182
1410
|
"model": Model
|
|
1183
1411
|
})
|
|
1184
1412
|
{}
|
|
@@ -1226,12 +1454,11 @@ export const make = (
|
|
|
1226
1454
|
httpClient.execute(request),
|
|
1227
1455
|
HttpClientResponse.matchStatus({
|
|
1228
1456
|
"200": (r) => HttpClientResponse.schemaBodyJson(Message)(r),
|
|
1229
|
-
"
|
|
1457
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1230
1458
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1231
1459
|
})
|
|
1232
1460
|
))
|
|
1233
|
-
)
|
|
1234
|
-
Effect.scoped
|
|
1461
|
+
)
|
|
1235
1462
|
),
|
|
1236
1463
|
"completePost": (options) =>
|
|
1237
1464
|
HttpClientRequest.make("POST")(`/v1/complete`).pipe(
|
|
@@ -1243,19 +1470,18 @@ export const make = (
|
|
|
1243
1470
|
httpClient.execute(request),
|
|
1244
1471
|
HttpClientResponse.matchStatus({
|
|
1245
1472
|
"200": (r) => HttpClientResponse.schemaBodyJson(CompletionResponse)(r),
|
|
1246
|
-
"
|
|
1473
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1247
1474
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1248
1475
|
})
|
|
1249
1476
|
))
|
|
1250
|
-
)
|
|
1251
|
-
Effect.scoped
|
|
1477
|
+
)
|
|
1252
1478
|
),
|
|
1253
1479
|
"modelsList": (options) =>
|
|
1254
1480
|
HttpClientRequest.make("GET")(`/v1/models`).pipe(
|
|
1255
1481
|
HttpClientRequest.setUrlParams({
|
|
1256
|
-
"before_id": options["before_id"],
|
|
1257
|
-
"after_id": options["after_id"],
|
|
1258
|
-
"limit": options["limit"]
|
|
1482
|
+
"before_id": options["before_id"] as UrlParams.Coercible,
|
|
1483
|
+
"after_id": options["after_id"] as UrlParams.Coercible,
|
|
1484
|
+
"limit": options["limit"] as UrlParams.Coercible
|
|
1259
1485
|
}),
|
|
1260
1486
|
HttpClientRequest.setHeaders({
|
|
1261
1487
|
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
@@ -1268,12 +1494,11 @@ export const make = (
|
|
|
1268
1494
|
httpClient.execute(request),
|
|
1269
1495
|
HttpClientResponse.matchStatus({
|
|
1270
1496
|
"200": (r) => HttpClientResponse.schemaBodyJson(ListResponseModelInfo)(r),
|
|
1271
|
-
"
|
|
1497
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1272
1498
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1273
1499
|
})
|
|
1274
1500
|
))
|
|
1275
|
-
)
|
|
1276
|
-
Effect.scoped
|
|
1501
|
+
)
|
|
1277
1502
|
),
|
|
1278
1503
|
"modelsGet": (modelId, options) =>
|
|
1279
1504
|
HttpClientRequest.make("GET")(`/v1/models/${modelId}`).pipe(
|
|
@@ -1288,19 +1513,18 @@ export const make = (
|
|
|
1288
1513
|
httpClient.execute(request),
|
|
1289
1514
|
HttpClientResponse.matchStatus({
|
|
1290
1515
|
"200": (r) => HttpClientResponse.schemaBodyJson(ModelInfo)(r),
|
|
1291
|
-
"
|
|
1516
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1292
1517
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1293
1518
|
})
|
|
1294
1519
|
))
|
|
1295
|
-
)
|
|
1296
|
-
Effect.scoped
|
|
1520
|
+
)
|
|
1297
1521
|
),
|
|
1298
1522
|
"messageBatchesList": (options) =>
|
|
1299
1523
|
HttpClientRequest.make("GET")(`/v1/messages/batches`).pipe(
|
|
1300
1524
|
HttpClientRequest.setUrlParams({
|
|
1301
|
-
"before_id": options["before_id"],
|
|
1302
|
-
"after_id": options["after_id"],
|
|
1303
|
-
"limit": options["limit"]
|
|
1525
|
+
"before_id": options["before_id"] as UrlParams.Coercible,
|
|
1526
|
+
"after_id": options["after_id"] as UrlParams.Coercible,
|
|
1527
|
+
"limit": options["limit"] as UrlParams.Coercible
|
|
1304
1528
|
}),
|
|
1305
1529
|
HttpClientRequest.setHeaders({
|
|
1306
1530
|
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
@@ -1313,12 +1537,11 @@ export const make = (
|
|
|
1313
1537
|
httpClient.execute(request),
|
|
1314
1538
|
HttpClientResponse.matchStatus({
|
|
1315
1539
|
"200": (r) => HttpClientResponse.schemaBodyJson(ListResponseMessageBatch)(r),
|
|
1316
|
-
"
|
|
1540
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1317
1541
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1318
1542
|
})
|
|
1319
1543
|
))
|
|
1320
|
-
)
|
|
1321
|
-
Effect.scoped
|
|
1544
|
+
)
|
|
1322
1545
|
),
|
|
1323
1546
|
"messageBatchesPost": (options) =>
|
|
1324
1547
|
HttpClientRequest.make("POST")(`/v1/messages/batches`).pipe(
|
|
@@ -1330,12 +1553,11 @@ export const make = (
|
|
|
1330
1553
|
httpClient.execute(request),
|
|
1331
1554
|
HttpClientResponse.matchStatus({
|
|
1332
1555
|
"200": (r) => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
|
|
1333
|
-
"
|
|
1556
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1334
1557
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1335
1558
|
})
|
|
1336
1559
|
))
|
|
1337
|
-
)
|
|
1338
|
-
Effect.scoped
|
|
1560
|
+
)
|
|
1339
1561
|
),
|
|
1340
1562
|
"messageBatchesRetrieve": (messageBatchId, options) =>
|
|
1341
1563
|
HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}`).pipe(
|
|
@@ -1352,13 +1574,12 @@ export const make = (
|
|
|
1352
1574
|
httpClient.execute(request),
|
|
1353
1575
|
HttpClientResponse.matchStatus({
|
|
1354
1576
|
"200": (r) => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
|
|
1355
|
-
"
|
|
1577
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1356
1578
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1357
1579
|
})
|
|
1358
1580
|
)
|
|
1359
1581
|
)
|
|
1360
|
-
)
|
|
1361
|
-
Effect.scoped
|
|
1582
|
+
)
|
|
1362
1583
|
),
|
|
1363
1584
|
"messageBatchesDelete": (messageBatchId, options) =>
|
|
1364
1585
|
HttpClientRequest.make("DELETE")(`/v1/messages/batches/${messageBatchId}`).pipe(
|
|
@@ -1375,13 +1596,12 @@ export const make = (
|
|
|
1375
1596
|
httpClient.execute(request),
|
|
1376
1597
|
HttpClientResponse.matchStatus({
|
|
1377
1598
|
"200": (r) => HttpClientResponse.schemaBodyJson(DeleteMessageBatchResponse)(r),
|
|
1378
|
-
"
|
|
1599
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1379
1600
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1380
1601
|
})
|
|
1381
1602
|
)
|
|
1382
1603
|
)
|
|
1383
|
-
)
|
|
1384
|
-
Effect.scoped
|
|
1604
|
+
)
|
|
1385
1605
|
),
|
|
1386
1606
|
"messageBatchesCancel": (messageBatchId, options) =>
|
|
1387
1607
|
HttpClientRequest.make("POST")(`/v1/messages/batches/${messageBatchId}/cancel`).pipe(
|
|
@@ -1395,13 +1615,12 @@ export const make = (
|
|
|
1395
1615
|
httpClient.execute(request),
|
|
1396
1616
|
HttpClientResponse.matchStatus({
|
|
1397
1617
|
"200": (r) => HttpClientResponse.schemaBodyJson(MessageBatch)(r),
|
|
1398
|
-
"
|
|
1618
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1399
1619
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1400
1620
|
})
|
|
1401
1621
|
)
|
|
1402
1622
|
)
|
|
1403
|
-
)
|
|
1404
|
-
Effect.scoped
|
|
1623
|
+
)
|
|
1405
1624
|
),
|
|
1406
1625
|
"messageBatchesResults": (messageBatchId, options) =>
|
|
1407
1626
|
HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}/results`).pipe(
|
|
@@ -1417,13 +1636,12 @@ export const make = (
|
|
|
1417
1636
|
Effect.flatMap(
|
|
1418
1637
|
httpClient.execute(request),
|
|
1419
1638
|
HttpClientResponse.matchStatus({
|
|
1420
|
-
"
|
|
1639
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1421
1640
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1422
1641
|
})
|
|
1423
1642
|
)
|
|
1424
1643
|
)
|
|
1425
|
-
)
|
|
1426
|
-
Effect.scoped
|
|
1644
|
+
)
|
|
1427
1645
|
),
|
|
1428
1646
|
"messagesCountTokensPost": (options) =>
|
|
1429
1647
|
HttpClientRequest.make("POST")(`/v1/messages/count_tokens`).pipe(
|
|
@@ -1435,12 +1653,11 @@ export const make = (
|
|
|
1435
1653
|
httpClient.execute(request),
|
|
1436
1654
|
HttpClientResponse.matchStatus({
|
|
1437
1655
|
"200": (r) => HttpClientResponse.schemaBodyJson(CountMessageTokensResponse)(r),
|
|
1438
|
-
"
|
|
1656
|
+
"4xx": (r) => decodeError(r, ErrorResponse),
|
|
1439
1657
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1440
1658
|
})
|
|
1441
1659
|
))
|
|
1442
|
-
)
|
|
1443
|
-
Effect.scoped
|
|
1660
|
+
)
|
|
1444
1661
|
),
|
|
1445
1662
|
"betaMessagesPost": (options) =>
|
|
1446
1663
|
HttpClientRequest.make("POST")(`/v1/messages?beta=true`).pipe(
|
|
@@ -1455,19 +1672,18 @@ export const make = (
|
|
|
1455
1672
|
httpClient.execute(request),
|
|
1456
1673
|
HttpClientResponse.matchStatus({
|
|
1457
1674
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaMessage)(r),
|
|
1458
|
-
"
|
|
1675
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1459
1676
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1460
1677
|
})
|
|
1461
1678
|
))
|
|
1462
|
-
)
|
|
1463
|
-
Effect.scoped
|
|
1679
|
+
)
|
|
1464
1680
|
),
|
|
1465
1681
|
"betaModelsList": (options) =>
|
|
1466
1682
|
HttpClientRequest.make("GET")(`/v1/models?beta=true`).pipe(
|
|
1467
1683
|
HttpClientRequest.setUrlParams({
|
|
1468
|
-
"before_id": options["before_id"],
|
|
1469
|
-
"after_id": options["after_id"],
|
|
1470
|
-
"limit": options["limit"]
|
|
1684
|
+
"before_id": options["before_id"] as UrlParams.Coercible,
|
|
1685
|
+
"after_id": options["after_id"] as UrlParams.Coercible,
|
|
1686
|
+
"limit": options["limit"] as UrlParams.Coercible
|
|
1471
1687
|
}),
|
|
1472
1688
|
HttpClientRequest.setHeaders({
|
|
1473
1689
|
"anthropic-version": options["anthropic-version"] ?? undefined,
|
|
@@ -1480,12 +1696,11 @@ export const make = (
|
|
|
1480
1696
|
httpClient.execute(request),
|
|
1481
1697
|
HttpClientResponse.matchStatus({
|
|
1482
1698
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaListResponseModelInfo)(r),
|
|
1483
|
-
"
|
|
1699
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1484
1700
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1485
1701
|
})
|
|
1486
1702
|
))
|
|
1487
|
-
)
|
|
1488
|
-
Effect.scoped
|
|
1703
|
+
)
|
|
1489
1704
|
),
|
|
1490
1705
|
"betaModelsGet": (modelId, options) =>
|
|
1491
1706
|
HttpClientRequest.make("GET")(`/v1/models/${modelId}?beta=true`).pipe(
|
|
@@ -1500,19 +1715,18 @@ export const make = (
|
|
|
1500
1715
|
httpClient.execute(request),
|
|
1501
1716
|
HttpClientResponse.matchStatus({
|
|
1502
1717
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaModelInfo)(r),
|
|
1503
|
-
"
|
|
1718
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1504
1719
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1505
1720
|
})
|
|
1506
1721
|
))
|
|
1507
|
-
)
|
|
1508
|
-
Effect.scoped
|
|
1722
|
+
)
|
|
1509
1723
|
),
|
|
1510
1724
|
"betaMessageBatchesList": (options) =>
|
|
1511
1725
|
HttpClientRequest.make("GET")(`/v1/messages/batches?beta=true`).pipe(
|
|
1512
1726
|
HttpClientRequest.setUrlParams({
|
|
1513
|
-
"before_id": options["before_id"],
|
|
1514
|
-
"after_id": options["after_id"],
|
|
1515
|
-
"limit": options["limit"]
|
|
1727
|
+
"before_id": options["before_id"] as UrlParams.Coercible,
|
|
1728
|
+
"after_id": options["after_id"] as UrlParams.Coercible,
|
|
1729
|
+
"limit": options["limit"] as UrlParams.Coercible
|
|
1516
1730
|
}),
|
|
1517
1731
|
HttpClientRequest.setHeaders({
|
|
1518
1732
|
"anthropic-beta": options["anthropic-beta"] ?? undefined,
|
|
@@ -1526,12 +1740,11 @@ export const make = (
|
|
|
1526
1740
|
httpClient.execute(request),
|
|
1527
1741
|
HttpClientResponse.matchStatus({
|
|
1528
1742
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaListResponseMessageBatch)(r),
|
|
1529
|
-
"
|
|
1743
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1530
1744
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1531
1745
|
})
|
|
1532
1746
|
))
|
|
1533
|
-
)
|
|
1534
|
-
Effect.scoped
|
|
1747
|
+
)
|
|
1535
1748
|
),
|
|
1536
1749
|
"betaMessageBatchesPost": (options) =>
|
|
1537
1750
|
HttpClientRequest.make("POST")(`/v1/messages/batches?beta=true`).pipe(
|
|
@@ -1546,12 +1759,11 @@ export const make = (
|
|
|
1546
1759
|
httpClient.execute(request),
|
|
1547
1760
|
HttpClientResponse.matchStatus({
|
|
1548
1761
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
|
|
1549
|
-
"
|
|
1762
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1550
1763
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1551
1764
|
})
|
|
1552
1765
|
))
|
|
1553
|
-
)
|
|
1554
|
-
Effect.scoped
|
|
1766
|
+
)
|
|
1555
1767
|
),
|
|
1556
1768
|
"betaMessageBatchesRetrieve": (messageBatchId, options) =>
|
|
1557
1769
|
HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}?beta=true`).pipe(
|
|
@@ -1569,13 +1781,12 @@ export const make = (
|
|
|
1569
1781
|
httpClient.execute(request),
|
|
1570
1782
|
HttpClientResponse.matchStatus({
|
|
1571
1783
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
|
|
1572
|
-
"
|
|
1784
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1573
1785
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1574
1786
|
})
|
|
1575
1787
|
)
|
|
1576
1788
|
)
|
|
1577
|
-
)
|
|
1578
|
-
Effect.scoped
|
|
1789
|
+
)
|
|
1579
1790
|
),
|
|
1580
1791
|
"betaMessageBatchesDelete": (messageBatchId, options) =>
|
|
1581
1792
|
HttpClientRequest.make("DELETE")(`/v1/messages/batches/${messageBatchId}?beta=true`).pipe(
|
|
@@ -1593,13 +1804,12 @@ export const make = (
|
|
|
1593
1804
|
httpClient.execute(request),
|
|
1594
1805
|
HttpClientResponse.matchStatus({
|
|
1595
1806
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaDeleteMessageBatchResponse)(r),
|
|
1596
|
-
"
|
|
1807
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1597
1808
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1598
1809
|
})
|
|
1599
1810
|
)
|
|
1600
1811
|
)
|
|
1601
|
-
)
|
|
1602
|
-
Effect.scoped
|
|
1812
|
+
)
|
|
1603
1813
|
),
|
|
1604
1814
|
"betaMessageBatchesCancel": (messageBatchId, options) =>
|
|
1605
1815
|
HttpClientRequest.make("POST")(`/v1/messages/batches/${messageBatchId}/cancel?beta=true`).pipe(
|
|
@@ -1616,13 +1826,12 @@ export const make = (
|
|
|
1616
1826
|
httpClient.execute(request),
|
|
1617
1827
|
HttpClientResponse.matchStatus({
|
|
1618
1828
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaMessageBatch)(r),
|
|
1619
|
-
"
|
|
1829
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1620
1830
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1621
1831
|
})
|
|
1622
1832
|
)
|
|
1623
1833
|
)
|
|
1624
|
-
)
|
|
1625
|
-
Effect.scoped
|
|
1834
|
+
)
|
|
1626
1835
|
),
|
|
1627
1836
|
"betaMessageBatchesResults": (messageBatchId, options) =>
|
|
1628
1837
|
HttpClientRequest.make("GET")(`/v1/messages/batches/${messageBatchId}/results?beta=true`).pipe(
|
|
@@ -1639,13 +1848,12 @@ export const make = (
|
|
|
1639
1848
|
Effect.flatMap(
|
|
1640
1849
|
httpClient.execute(request),
|
|
1641
1850
|
HttpClientResponse.matchStatus({
|
|
1642
|
-
"
|
|
1851
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1643
1852
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1644
1853
|
})
|
|
1645
1854
|
)
|
|
1646
1855
|
)
|
|
1647
|
-
)
|
|
1648
|
-
Effect.scoped
|
|
1856
|
+
)
|
|
1649
1857
|
),
|
|
1650
1858
|
"betaMessagesCountTokensPost": (options) =>
|
|
1651
1859
|
HttpClientRequest.make("POST")(`/v1/messages/count_tokens?beta=true`).pipe(
|
|
@@ -1662,13 +1870,12 @@ export const make = (
|
|
|
1662
1870
|
httpClient.execute(request),
|
|
1663
1871
|
HttpClientResponse.matchStatus({
|
|
1664
1872
|
"200": (r) => HttpClientResponse.schemaBodyJson(BetaCountMessageTokensResponse)(r),
|
|
1665
|
-
"
|
|
1873
|
+
"4xx": (r) => decodeError(r, BetaErrorResponse),
|
|
1666
1874
|
orElse: (response) => unexpectedStatus(request, response)
|
|
1667
1875
|
})
|
|
1668
1876
|
)
|
|
1669
1877
|
)
|
|
1670
|
-
)
|
|
1671
|
-
Effect.scoped
|
|
1878
|
+
)
|
|
1672
1879
|
)
|
|
1673
1880
|
}
|
|
1674
1881
|
}
|