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