@effect/ai-anthropic 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/AnthropicClient.js +1 -2
- package/dist/cjs/AnthropicClient.js.map +1 -1
- package/dist/cjs/AnthropicConfig.js +2 -3
- package/dist/cjs/AnthropicConfig.js.map +1 -1
- package/dist/cjs/AnthropicLanguageModel.js +2 -3
- package/dist/cjs/AnthropicLanguageModel.js.map +1 -1
- package/dist/cjs/AnthropicTokenizer.js +1 -2
- package/dist/cjs/AnthropicTokenizer.js.map +1 -1
- package/dist/cjs/Generated.js +135 -136
- package/dist/cjs/Generated.js.map +1 -1
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/internal/utilities.js +1 -2
- package/dist/cjs/internal/utilities.js.map +1 -1
- package/dist/dts/AnthropicClient.d.ts.map +1 -1
- package/dist/dts/AnthropicLanguageModel.d.ts.map +1 -1
- package/dist/dts/Generated.d.ts.map +1 -1
- package/dist/esm/AnthropicConfig.js +1 -1
- package/dist/esm/AnthropicConfig.js.map +1 -1
- package/dist/esm/AnthropicLanguageModel.js +1 -1
- package/dist/esm/AnthropicLanguageModel.js.map +1 -1
- package/dist/esm/Generated.js +134 -134
- package/dist/esm/Generated.js.map +1 -1
- package/package.json +5 -5
package/dist/cjs/Generated.js
CHANGED
|
@@ -11,15 +11,14 @@ var HttpClientRequest = _interopRequireWildcard(require("@effect/platform/HttpCl
|
|
|
11
11
|
var HttpClientResponse = _interopRequireWildcard(require("@effect/platform/HttpClientResponse"));
|
|
12
12
|
var Effect = _interopRequireWildcard(require("effect/Effect"));
|
|
13
13
|
var S = _interopRequireWildcard(require("effect/Schema"));
|
|
14
|
-
function
|
|
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; }
|
|
14
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
16
15
|
class MessagesPostParams extends /*#__PURE__*/S.Struct({
|
|
17
16
|
"anthropic-version": /*#__PURE__*/S.optionalWith(S.String, {
|
|
18
17
|
nullable: true
|
|
19
18
|
})
|
|
20
19
|
}) {}
|
|
21
20
|
exports.MessagesPostParams = MessagesPostParams;
|
|
22
|
-
class Model extends /*#__PURE__*/S.Union(
|
|
21
|
+
class Model extends /*#__PURE__*/S.Union(/*#__PURE__*/S.Literal("claude-3-7-sonnet-latest"), /*#__PURE__*/S.Literal("claude-3-7-sonnet-20250219"), /*#__PURE__*/S.Literal("claude-3-5-haiku-latest"), /*#__PURE__*/S.Literal("claude-3-5-haiku-20241022"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-latest"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-20241022"), /*#__PURE__*/S.Literal("claude-3-5-sonnet-20240620"), /*#__PURE__*/S.Literal("claude-3-opus-latest"), /*#__PURE__*/S.Literal("claude-3-opus-20240229"), /*#__PURE__*/S.Literal("claude-3-sonnet-20240229"), /*#__PURE__*/S.Literal("claude-3-haiku-20240307"), /*#__PURE__*/S.Literal("claude-2.1"), /*#__PURE__*/S.Literal("claude-2.0")) {}
|
|
23
22
|
exports.Model = Model;
|
|
24
23
|
class InputMessageRole extends /*#__PURE__*/S.Literal("user", "assistant") {}
|
|
25
24
|
exports.InputMessageRole = InputMessageRole;
|
|
@@ -34,9 +33,9 @@ exports.RequestCharLocationCitationType = RequestCharLocationCitationType;
|
|
|
34
33
|
class RequestCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
35
34
|
"type": RequestCharLocationCitationType,
|
|
36
35
|
"cited_text": S.String,
|
|
37
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
38
|
-
"document_title": /*#__PURE__*/S.Union(
|
|
39
|
-
"start_char_index": /*#__PURE__*/S.Int.pipe(
|
|
36
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
37
|
+
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
38
|
+
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
40
39
|
"end_char_index": S.Int
|
|
41
40
|
}) {}
|
|
42
41
|
exports.RequestCharLocationCitation = RequestCharLocationCitation;
|
|
@@ -45,9 +44,9 @@ exports.RequestPageLocationCitationType = RequestPageLocationCitationType;
|
|
|
45
44
|
class RequestPageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
46
45
|
"type": RequestPageLocationCitationType,
|
|
47
46
|
"cited_text": S.String,
|
|
48
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
49
|
-
"document_title": /*#__PURE__*/S.Union(
|
|
50
|
-
"start_page_number": /*#__PURE__*/S.Int.pipe(
|
|
47
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
48
|
+
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
49
|
+
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
51
50
|
"end_page_number": S.Int
|
|
52
51
|
}) {}
|
|
53
52
|
exports.RequestPageLocationCitation = RequestPageLocationCitation;
|
|
@@ -56,22 +55,22 @@ exports.RequestContentBlockLocationCitationType = RequestContentBlockLocationCit
|
|
|
56
55
|
class RequestContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
57
56
|
"type": RequestContentBlockLocationCitationType,
|
|
58
57
|
"cited_text": S.String,
|
|
59
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
60
|
-
"document_title": /*#__PURE__*/S.Union(
|
|
61
|
-
"start_block_index": /*#__PURE__*/S.Int.pipe(
|
|
58
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
59
|
+
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
60
|
+
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
62
61
|
"end_block_index": S.Int
|
|
63
62
|
}) {}
|
|
64
63
|
exports.RequestContentBlockLocationCitation = RequestContentBlockLocationCitation;
|
|
65
64
|
class RequestTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
66
65
|
exports.RequestTextBlockType = RequestTextBlockType;
|
|
67
66
|
class RequestTextBlock extends /*#__PURE__*/S.Struct({
|
|
68
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
67
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
69
68
|
nullable: true
|
|
70
69
|
}),
|
|
71
|
-
"citations": /*#__PURE__*/S.optionalWith(
|
|
70
|
+
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(RequestCharLocationCitation, RequestPageLocationCitation, RequestContentBlockLocationCitation)), S.Null), {
|
|
72
71
|
nullable: true
|
|
73
72
|
}),
|
|
74
|
-
"text": /*#__PURE__*/S.String.pipe(
|
|
73
|
+
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
75
74
|
"type": RequestTextBlockType
|
|
76
75
|
}) {}
|
|
77
76
|
exports.RequestTextBlock = RequestTextBlock;
|
|
@@ -95,7 +94,7 @@ class URLImageSource extends /*#__PURE__*/S.Struct({
|
|
|
95
94
|
}) {}
|
|
96
95
|
exports.URLImageSource = URLImageSource;
|
|
97
96
|
class RequestImageBlock extends /*#__PURE__*/S.Struct({
|
|
98
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
97
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
99
98
|
nullable: true
|
|
100
99
|
}),
|
|
101
100
|
"type": RequestImageBlockType,
|
|
@@ -105,12 +104,12 @@ exports.RequestImageBlock = RequestImageBlock;
|
|
|
105
104
|
class RequestToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
106
105
|
exports.RequestToolUseBlockType = RequestToolUseBlockType;
|
|
107
106
|
class RequestToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
108
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
107
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
109
108
|
nullable: true
|
|
110
109
|
}),
|
|
111
110
|
"type": RequestToolUseBlockType,
|
|
112
|
-
"id": /*#__PURE__*/S.String.pipe(
|
|
113
|
-
"name": /*#__PURE__*/S.String.pipe(
|
|
111
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
112
|
+
"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}$"))),
|
|
114
113
|
"input": /*#__PURE__*/S.Record({
|
|
115
114
|
key: S.String,
|
|
116
115
|
value: S.Unknown
|
|
@@ -120,15 +119,15 @@ exports.RequestToolUseBlock = RequestToolUseBlock;
|
|
|
120
119
|
class RequestToolResultBlockType extends /*#__PURE__*/S.Literal("tool_result") {}
|
|
121
120
|
exports.RequestToolResultBlockType = RequestToolResultBlockType;
|
|
122
121
|
class RequestToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
123
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
122
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
124
123
|
nullable: true
|
|
125
124
|
}),
|
|
126
125
|
"type": RequestToolResultBlockType,
|
|
127
|
-
"tool_use_id": /*#__PURE__*/S.String.pipe(
|
|
126
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
128
127
|
"is_error": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
129
128
|
nullable: true
|
|
130
129
|
}),
|
|
131
|
-
"content": /*#__PURE__*/S.optionalWith(
|
|
130
|
+
"content": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock))), {
|
|
132
131
|
nullable: true
|
|
133
132
|
})
|
|
134
133
|
}) {}
|
|
@@ -159,7 +158,7 @@ class ContentBlockSourceType extends /*#__PURE__*/S.Literal("content") {}
|
|
|
159
158
|
exports.ContentBlockSourceType = ContentBlockSourceType;
|
|
160
159
|
class ContentBlockSource extends /*#__PURE__*/S.Struct({
|
|
161
160
|
"type": ContentBlockSourceType,
|
|
162
|
-
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(
|
|
161
|
+
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(RequestTextBlock, RequestImageBlock)))
|
|
163
162
|
}) {}
|
|
164
163
|
exports.ContentBlockSource = ContentBlockSource;
|
|
165
164
|
class URLPDFSourceType extends /*#__PURE__*/S.Literal("url") {}
|
|
@@ -176,15 +175,15 @@ class RequestCitationsConfig extends /*#__PURE__*/S.Struct({
|
|
|
176
175
|
}) {}
|
|
177
176
|
exports.RequestCitationsConfig = RequestCitationsConfig;
|
|
178
177
|
class RequestDocumentBlock extends /*#__PURE__*/S.Struct({
|
|
179
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
178
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
180
179
|
nullable: true
|
|
181
180
|
}),
|
|
182
181
|
"type": RequestDocumentBlockType,
|
|
183
182
|
"source": /*#__PURE__*/S.Union(Base64PDFSource, PlainTextSource, ContentBlockSource, URLPDFSource),
|
|
184
|
-
"title": /*#__PURE__*/S.optionalWith(
|
|
183
|
+
"title": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)), S.Null), {
|
|
185
184
|
nullable: true
|
|
186
185
|
}),
|
|
187
|
-
"context": /*#__PURE__*/S.optionalWith(
|
|
186
|
+
"context": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)), S.Null), {
|
|
188
187
|
nullable: true
|
|
189
188
|
}),
|
|
190
189
|
"citations": /*#__PURE__*/S.optionalWith(RequestCitationsConfig, {
|
|
@@ -215,7 +214,7 @@ class InputMessage extends /*#__PURE__*/S.Struct({
|
|
|
215
214
|
}) {}
|
|
216
215
|
exports.InputMessage = InputMessage;
|
|
217
216
|
class Metadata extends /*#__PURE__*/S.Struct({
|
|
218
|
-
"user_id": /*#__PURE__*/S.optionalWith(
|
|
217
|
+
"user_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.maxLength(256)), S.Null), {
|
|
219
218
|
nullable: true
|
|
220
219
|
})
|
|
221
220
|
}) {}
|
|
@@ -224,7 +223,7 @@ class ThinkingConfigEnabledType extends /*#__PURE__*/S.Literal("enabled") {}
|
|
|
224
223
|
exports.ThinkingConfigEnabledType = ThinkingConfigEnabledType;
|
|
225
224
|
class ThinkingConfigEnabled extends /*#__PURE__*/S.Struct({
|
|
226
225
|
"type": ThinkingConfigEnabledType,
|
|
227
|
-
"budget_tokens": /*#__PURE__*/S.Int.pipe(
|
|
226
|
+
"budget_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1024))
|
|
228
227
|
}) {}
|
|
229
228
|
exports.ThinkingConfigEnabled = ThinkingConfigEnabled;
|
|
230
229
|
class ThinkingConfigDisabledType extends /*#__PURE__*/S.Literal("disabled") {}
|
|
@@ -275,7 +274,7 @@ class InputSchemaType extends /*#__PURE__*/S.Literal("object") {}
|
|
|
275
274
|
exports.InputSchemaType = InputSchemaType;
|
|
276
275
|
class InputSchema extends /*#__PURE__*/S.Struct({
|
|
277
276
|
"type": InputSchemaType,
|
|
278
|
-
"properties": /*#__PURE__*/S.optionalWith(
|
|
277
|
+
"properties": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Record({
|
|
279
278
|
key: S.String,
|
|
280
279
|
value: S.Unknown
|
|
281
280
|
}), S.Null), {
|
|
@@ -287,9 +286,9 @@ class Tool extends /*#__PURE__*/S.Struct({
|
|
|
287
286
|
"description": /*#__PURE__*/S.optionalWith(S.String, {
|
|
288
287
|
nullable: true
|
|
289
288
|
}),
|
|
290
|
-
"name": /*#__PURE__*/S.String.pipe(
|
|
289
|
+
"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}$"))),
|
|
291
290
|
"input_schema": InputSchema,
|
|
292
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
291
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
293
292
|
nullable: true
|
|
294
293
|
})
|
|
295
294
|
}) {}
|
|
@@ -299,7 +298,7 @@ exports.BashTool20250124Type = BashTool20250124Type;
|
|
|
299
298
|
class BashTool20250124Name extends /*#__PURE__*/S.Literal("bash") {}
|
|
300
299
|
exports.BashTool20250124Name = BashTool20250124Name;
|
|
301
300
|
class BashTool20250124 extends /*#__PURE__*/S.Struct({
|
|
302
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
301
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
303
302
|
nullable: true
|
|
304
303
|
}),
|
|
305
304
|
"type": BashTool20250124Type,
|
|
@@ -311,7 +310,7 @@ exports.TextEditor20250124Type = TextEditor20250124Type;
|
|
|
311
310
|
class TextEditor20250124Name extends /*#__PURE__*/S.Literal("str_replace_editor") {}
|
|
312
311
|
exports.TextEditor20250124Name = TextEditor20250124Name;
|
|
313
312
|
class TextEditor20250124 extends /*#__PURE__*/S.Struct({
|
|
314
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
313
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(CacheControlEphemeral, S.Null), {
|
|
315
314
|
nullable: true
|
|
316
315
|
}),
|
|
317
316
|
"type": TextEditor20250124Type,
|
|
@@ -321,20 +320,20 @@ exports.TextEditor20250124 = TextEditor20250124;
|
|
|
321
320
|
class CreateMessageParams extends /*#__PURE__*/S.Class("CreateMessageParams")({
|
|
322
321
|
"model": Model,
|
|
323
322
|
"messages": /*#__PURE__*/S.Array(InputMessage),
|
|
324
|
-
"max_tokens": /*#__PURE__*/S.Int.pipe(
|
|
323
|
+
"max_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
325
324
|
"metadata": /*#__PURE__*/S.optionalWith(Metadata, {
|
|
326
325
|
nullable: true
|
|
327
326
|
}),
|
|
328
|
-
"stop_sequences": /*#__PURE__*/S.optionalWith(
|
|
327
|
+
"stop_sequences": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(S.String), {
|
|
329
328
|
nullable: true
|
|
330
329
|
}),
|
|
331
330
|
"stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
332
331
|
nullable: true
|
|
333
332
|
}),
|
|
334
|
-
"system": /*#__PURE__*/S.optionalWith(
|
|
333
|
+
"system": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(RequestTextBlock)), {
|
|
335
334
|
nullable: true
|
|
336
335
|
}),
|
|
337
|
-
"temperature": /*#__PURE__*/S.optionalWith(
|
|
336
|
+
"temperature": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Number.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
|
|
338
337
|
nullable: true
|
|
339
338
|
}),
|
|
340
339
|
"thinking": /*#__PURE__*/S.optionalWith(ThinkingConfigParam, {
|
|
@@ -343,13 +342,13 @@ class CreateMessageParams extends /*#__PURE__*/S.Class("CreateMessageParams")({
|
|
|
343
342
|
"tool_choice": /*#__PURE__*/S.optionalWith(ToolChoice, {
|
|
344
343
|
nullable: true
|
|
345
344
|
}),
|
|
346
|
-
"tools": /*#__PURE__*/S.optionalWith(
|
|
345
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(Tool, BashTool20250124, TextEditor20250124)), {
|
|
347
346
|
nullable: true
|
|
348
347
|
}),
|
|
349
|
-
"top_k": /*#__PURE__*/S.optionalWith(
|
|
348
|
+
"top_k": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), {
|
|
350
349
|
nullable: true
|
|
351
350
|
}),
|
|
352
|
-
"top_p": /*#__PURE__*/S.optionalWith(
|
|
351
|
+
"top_p": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Number.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
|
|
353
352
|
nullable: true
|
|
354
353
|
})
|
|
355
354
|
}) {}
|
|
@@ -365,9 +364,9 @@ exports.ResponseCharLocationCitationType = ResponseCharLocationCitationType;
|
|
|
365
364
|
class ResponseCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
366
365
|
"type": /*#__PURE__*/ResponseCharLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "char_location")),
|
|
367
366
|
"cited_text": S.String,
|
|
368
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
367
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
369
368
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
370
|
-
"start_char_index": /*#__PURE__*/S.Int.pipe(
|
|
369
|
+
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
371
370
|
"end_char_index": S.Int
|
|
372
371
|
}) {}
|
|
373
372
|
exports.ResponseCharLocationCitation = ResponseCharLocationCitation;
|
|
@@ -376,9 +375,9 @@ exports.ResponsePageLocationCitationType = ResponsePageLocationCitationType;
|
|
|
376
375
|
class ResponsePageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
377
376
|
"type": /*#__PURE__*/ResponsePageLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "page_location")),
|
|
378
377
|
"cited_text": S.String,
|
|
379
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
378
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
380
379
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
381
|
-
"start_page_number": /*#__PURE__*/S.Int.pipe(
|
|
380
|
+
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
382
381
|
"end_page_number": S.Int
|
|
383
382
|
}) {}
|
|
384
383
|
exports.ResponsePageLocationCitation = ResponsePageLocationCitation;
|
|
@@ -387,16 +386,16 @@ exports.ResponseContentBlockLocationCitationType = ResponseContentBlockLocationC
|
|
|
387
386
|
class ResponseContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
388
387
|
"type": /*#__PURE__*/ResponseContentBlockLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "content_block_location")),
|
|
389
388
|
"cited_text": S.String,
|
|
390
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
389
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
391
390
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
392
|
-
"start_block_index": /*#__PURE__*/S.Int.pipe(
|
|
391
|
+
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
393
392
|
"end_block_index": S.Int
|
|
394
393
|
}) {}
|
|
395
394
|
exports.ResponseContentBlockLocationCitation = ResponseContentBlockLocationCitation;
|
|
396
395
|
class ResponseTextBlock extends /*#__PURE__*/S.Struct({
|
|
397
396
|
"type": /*#__PURE__*/ResponseTextBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "text")),
|
|
398
|
-
"text": /*#__PURE__*/S.String.pipe(
|
|
399
|
-
"citations": /*#__PURE__*/S.optionalWith(
|
|
397
|
+
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(0), /*#__PURE__*/S.maxLength(5000000)),
|
|
398
|
+
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(ResponseCharLocationCitation, ResponsePageLocationCitation, ResponseContentBlockLocationCitation)), S.Null)), {
|
|
400
399
|
default: () => null
|
|
401
400
|
})
|
|
402
401
|
}) {}
|
|
@@ -405,8 +404,8 @@ class ResponseToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
|
405
404
|
exports.ResponseToolUseBlockType = ResponseToolUseBlockType;
|
|
406
405
|
class ResponseToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
407
406
|
"type": /*#__PURE__*/ResponseToolUseBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "tool_use")),
|
|
408
|
-
"id": /*#__PURE__*/S.String.pipe(
|
|
409
|
-
"name": /*#__PURE__*/S.String.pipe(
|
|
407
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
408
|
+
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
410
409
|
"input": /*#__PURE__*/S.Record({
|
|
411
410
|
key: S.String,
|
|
412
411
|
value: S.Unknown
|
|
@@ -433,14 +432,14 @@ exports.ContentBlock = ContentBlock;
|
|
|
433
432
|
class MessageStopReasonEnum extends /*#__PURE__*/S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use") {}
|
|
434
433
|
exports.MessageStopReasonEnum = MessageStopReasonEnum;
|
|
435
434
|
class Usage extends /*#__PURE__*/S.Struct({
|
|
436
|
-
"input_tokens": /*#__PURE__*/S.Int.pipe(
|
|
437
|
-
"cache_creation_input_tokens": /*#__PURE__*/S.optionalWith(
|
|
435
|
+
"input_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
436
|
+
"cache_creation_input_tokens": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
|
|
438
437
|
default: () => null
|
|
439
438
|
}),
|
|
440
|
-
"cache_read_input_tokens": /*#__PURE__*/S.optionalWith(
|
|
439
|
+
"cache_read_input_tokens": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
|
|
441
440
|
default: () => null
|
|
442
441
|
}),
|
|
443
|
-
"output_tokens": /*#__PURE__*/S.Int.pipe(
|
|
442
|
+
"output_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0))
|
|
444
443
|
}) {}
|
|
445
444
|
exports.Usage = Usage;
|
|
446
445
|
class Message extends /*#__PURE__*/S.Class("Message")({
|
|
@@ -450,7 +449,7 @@ class Message extends /*#__PURE__*/S.Class("Message")({
|
|
|
450
449
|
"content": /*#__PURE__*/S.Array(ContentBlock),
|
|
451
450
|
"model": Model,
|
|
452
451
|
"stop_reason": /*#__PURE__*/S.Union(MessageStopReasonEnum, S.Null),
|
|
453
|
-
"stop_sequence": /*#__PURE__*/S.optionalWith(
|
|
452
|
+
"stop_sequence": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(S.String, S.Null)), {
|
|
454
453
|
default: () => null
|
|
455
454
|
}),
|
|
456
455
|
"usage": Usage
|
|
@@ -534,18 +533,18 @@ class CompletePostParams extends /*#__PURE__*/S.Struct({
|
|
|
534
533
|
exports.CompletePostParams = CompletePostParams;
|
|
535
534
|
class CompletionRequest extends /*#__PURE__*/S.Class("CompletionRequest")({
|
|
536
535
|
"model": Model,
|
|
537
|
-
"prompt": /*#__PURE__*/S.String.pipe(
|
|
538
|
-
"max_tokens_to_sample": /*#__PURE__*/S.Int.pipe(
|
|
539
|
-
"stop_sequences": /*#__PURE__*/S.optionalWith(
|
|
536
|
+
"prompt": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
537
|
+
"max_tokens_to_sample": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
538
|
+
"stop_sequences": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(S.String), {
|
|
540
539
|
nullable: true
|
|
541
540
|
}),
|
|
542
|
-
"temperature": /*#__PURE__*/S.optionalWith(
|
|
541
|
+
"temperature": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Number.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
|
|
543
542
|
nullable: true
|
|
544
543
|
}),
|
|
545
|
-
"top_p": /*#__PURE__*/S.optionalWith(
|
|
544
|
+
"top_p": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Number.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
|
|
546
545
|
nullable: true
|
|
547
546
|
}),
|
|
548
|
-
"top_k": /*#__PURE__*/S.optionalWith(
|
|
547
|
+
"top_k": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), {
|
|
549
548
|
nullable: true
|
|
550
549
|
}),
|
|
551
550
|
"metadata": /*#__PURE__*/S.optionalWith(Metadata, {
|
|
@@ -573,7 +572,7 @@ class ModelsListParams extends /*#__PURE__*/S.Struct({
|
|
|
573
572
|
"after_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
574
573
|
nullable: true
|
|
575
574
|
}),
|
|
576
|
-
"limit": /*#__PURE__*/S.optionalWith(
|
|
575
|
+
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
577
576
|
nullable: true,
|
|
578
577
|
default: () => 20
|
|
579
578
|
}),
|
|
@@ -617,7 +616,7 @@ class MessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
|
617
616
|
"after_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
618
617
|
nullable: true
|
|
619
618
|
}),
|
|
620
|
-
"limit": /*#__PURE__*/S.optionalWith(
|
|
619
|
+
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
621
620
|
nullable: true,
|
|
622
621
|
default: () => 20
|
|
623
622
|
}),
|
|
@@ -668,12 +667,12 @@ class MessageBatchesPostParams extends /*#__PURE__*/S.Struct({
|
|
|
668
667
|
}) {}
|
|
669
668
|
exports.MessageBatchesPostParams = MessageBatchesPostParams;
|
|
670
669
|
class MessageBatchIndividualRequestParams extends /*#__PURE__*/S.Struct({
|
|
671
|
-
"custom_id": /*#__PURE__*/S.String.pipe(
|
|
670
|
+
"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}$"))),
|
|
672
671
|
"params": CreateMessageParams
|
|
673
672
|
}) {}
|
|
674
673
|
exports.MessageBatchIndividualRequestParams = MessageBatchIndividualRequestParams;
|
|
675
674
|
class CreateMessageBatchParams extends /*#__PURE__*/S.Class("CreateMessageBatchParams")({
|
|
676
|
-
"requests": /*#__PURE__*/S.Array(MessageBatchIndividualRequestParams).pipe(
|
|
675
|
+
"requests": /*#__PURE__*/S.Array(MessageBatchIndividualRequestParams).pipe(/*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(10000))
|
|
677
676
|
}) {}
|
|
678
677
|
exports.CreateMessageBatchParams = CreateMessageBatchParams;
|
|
679
678
|
class MessageBatchesRetrieveParams extends /*#__PURE__*/S.Struct({
|
|
@@ -726,11 +725,11 @@ class CountMessageTokensParams extends /*#__PURE__*/S.Class("CountMessageTokensP
|
|
|
726
725
|
"tool_choice": /*#__PURE__*/S.optionalWith(ToolChoice, {
|
|
727
726
|
nullable: true
|
|
728
727
|
}),
|
|
729
|
-
"tools": /*#__PURE__*/S.optionalWith(
|
|
728
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(Tool, BashTool20250124, TextEditor20250124)), {
|
|
730
729
|
nullable: true
|
|
731
730
|
}),
|
|
732
731
|
"messages": /*#__PURE__*/S.Array(InputMessage),
|
|
733
|
-
"system": /*#__PURE__*/S.optionalWith(
|
|
732
|
+
"system": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(RequestTextBlock)), {
|
|
734
733
|
nullable: true
|
|
735
734
|
}),
|
|
736
735
|
"thinking": /*#__PURE__*/S.optionalWith(ThinkingConfigParam, {
|
|
@@ -765,9 +764,9 @@ exports.BetaRequestCharLocationCitationType = BetaRequestCharLocationCitationTyp
|
|
|
765
764
|
class BetaRequestCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
766
765
|
"type": BetaRequestCharLocationCitationType,
|
|
767
766
|
"cited_text": S.String,
|
|
768
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
769
|
-
"document_title": /*#__PURE__*/S.Union(
|
|
770
|
-
"start_char_index": /*#__PURE__*/S.Int.pipe(
|
|
767
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
768
|
+
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
769
|
+
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
771
770
|
"end_char_index": S.Int
|
|
772
771
|
}) {}
|
|
773
772
|
exports.BetaRequestCharLocationCitation = BetaRequestCharLocationCitation;
|
|
@@ -776,9 +775,9 @@ exports.BetaRequestPageLocationCitationType = BetaRequestPageLocationCitationTyp
|
|
|
776
775
|
class BetaRequestPageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
777
776
|
"type": BetaRequestPageLocationCitationType,
|
|
778
777
|
"cited_text": S.String,
|
|
779
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
780
|
-
"document_title": /*#__PURE__*/S.Union(
|
|
781
|
-
"start_page_number": /*#__PURE__*/S.Int.pipe(
|
|
778
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
779
|
+
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
780
|
+
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
782
781
|
"end_page_number": S.Int
|
|
783
782
|
}) {}
|
|
784
783
|
exports.BetaRequestPageLocationCitation = BetaRequestPageLocationCitation;
|
|
@@ -787,22 +786,22 @@ exports.BetaRequestContentBlockLocationCitationType = BetaRequestContentBlockLoc
|
|
|
787
786
|
class BetaRequestContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
788
787
|
"type": BetaRequestContentBlockLocationCitationType,
|
|
789
788
|
"cited_text": S.String,
|
|
790
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
791
|
-
"document_title": /*#__PURE__*/S.Union(
|
|
792
|
-
"start_block_index": /*#__PURE__*/S.Int.pipe(
|
|
789
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
790
|
+
"document_title": /*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(255)), S.Null),
|
|
791
|
+
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
793
792
|
"end_block_index": S.Int
|
|
794
793
|
}) {}
|
|
795
794
|
exports.BetaRequestContentBlockLocationCitation = BetaRequestContentBlockLocationCitation;
|
|
796
795
|
class BetaRequestTextBlockType extends /*#__PURE__*/S.Literal("text") {}
|
|
797
796
|
exports.BetaRequestTextBlockType = BetaRequestTextBlockType;
|
|
798
797
|
class BetaRequestTextBlock extends /*#__PURE__*/S.Struct({
|
|
799
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
798
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
800
799
|
nullable: true
|
|
801
800
|
}),
|
|
802
|
-
"citations": /*#__PURE__*/S.optionalWith(
|
|
801
|
+
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaRequestCharLocationCitation, BetaRequestPageLocationCitation, BetaRequestContentBlockLocationCitation)), S.Null), {
|
|
803
802
|
nullable: true
|
|
804
803
|
}),
|
|
805
|
-
"text": /*#__PURE__*/S.String.pipe(
|
|
804
|
+
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
806
805
|
"type": BetaRequestTextBlockType
|
|
807
806
|
}) {}
|
|
808
807
|
exports.BetaRequestTextBlock = BetaRequestTextBlock;
|
|
@@ -826,7 +825,7 @@ class BetaURLImageSource extends /*#__PURE__*/S.Struct({
|
|
|
826
825
|
}) {}
|
|
827
826
|
exports.BetaURLImageSource = BetaURLImageSource;
|
|
828
827
|
class BetaRequestImageBlock extends /*#__PURE__*/S.Struct({
|
|
829
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
828
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
830
829
|
nullable: true
|
|
831
830
|
}),
|
|
832
831
|
"type": BetaRequestImageBlockType,
|
|
@@ -836,12 +835,12 @@ exports.BetaRequestImageBlock = BetaRequestImageBlock;
|
|
|
836
835
|
class BetaRequestToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
837
836
|
exports.BetaRequestToolUseBlockType = BetaRequestToolUseBlockType;
|
|
838
837
|
class BetaRequestToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
839
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
838
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
840
839
|
nullable: true
|
|
841
840
|
}),
|
|
842
841
|
"type": BetaRequestToolUseBlockType,
|
|
843
|
-
"id": /*#__PURE__*/S.String.pipe(
|
|
844
|
-
"name": /*#__PURE__*/S.String.pipe(
|
|
842
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
843
|
+
"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}$"))),
|
|
845
844
|
"input": /*#__PURE__*/S.Record({
|
|
846
845
|
key: S.String,
|
|
847
846
|
value: S.Unknown
|
|
@@ -851,15 +850,15 @@ exports.BetaRequestToolUseBlock = BetaRequestToolUseBlock;
|
|
|
851
850
|
class BetaRequestToolResultBlockType extends /*#__PURE__*/S.Literal("tool_result") {}
|
|
852
851
|
exports.BetaRequestToolResultBlockType = BetaRequestToolResultBlockType;
|
|
853
852
|
class BetaRequestToolResultBlock extends /*#__PURE__*/S.Struct({
|
|
854
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
853
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
855
854
|
nullable: true
|
|
856
855
|
}),
|
|
857
856
|
"type": BetaRequestToolResultBlockType,
|
|
858
|
-
"tool_use_id": /*#__PURE__*/S.String.pipe(
|
|
857
|
+
"tool_use_id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
859
858
|
"is_error": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
860
859
|
nullable: true
|
|
861
860
|
}),
|
|
862
|
-
"content": /*#__PURE__*/S.optionalWith(
|
|
861
|
+
"content": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock))), {
|
|
863
862
|
nullable: true
|
|
864
863
|
})
|
|
865
864
|
}) {}
|
|
@@ -890,7 +889,7 @@ class BetaContentBlockSourceType extends /*#__PURE__*/S.Literal("content") {}
|
|
|
890
889
|
exports.BetaContentBlockSourceType = BetaContentBlockSourceType;
|
|
891
890
|
class BetaContentBlockSource extends /*#__PURE__*/S.Struct({
|
|
892
891
|
"type": BetaContentBlockSourceType,
|
|
893
|
-
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(
|
|
892
|
+
"content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaRequestTextBlock, BetaRequestImageBlock)))
|
|
894
893
|
}) {}
|
|
895
894
|
exports.BetaContentBlockSource = BetaContentBlockSource;
|
|
896
895
|
class BetaURLPDFSourceType extends /*#__PURE__*/S.Literal("url") {}
|
|
@@ -907,15 +906,15 @@ class BetaRequestCitationsConfig extends /*#__PURE__*/S.Struct({
|
|
|
907
906
|
}) {}
|
|
908
907
|
exports.BetaRequestCitationsConfig = BetaRequestCitationsConfig;
|
|
909
908
|
class BetaRequestDocumentBlock extends /*#__PURE__*/S.Struct({
|
|
910
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
909
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
911
910
|
nullable: true
|
|
912
911
|
}),
|
|
913
912
|
"type": BetaRequestDocumentBlockType,
|
|
914
913
|
"source": /*#__PURE__*/S.Union(BetaBase64PDFSource, BetaPlainTextSource, BetaContentBlockSource, BetaURLPDFSource),
|
|
915
|
-
"title": /*#__PURE__*/S.optionalWith(
|
|
914
|
+
"title": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(500)), S.Null), {
|
|
916
915
|
nullable: true
|
|
917
916
|
}),
|
|
918
|
-
"context": /*#__PURE__*/S.optionalWith(
|
|
917
|
+
"context": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)), S.Null), {
|
|
919
918
|
nullable: true
|
|
920
919
|
}),
|
|
921
920
|
"citations": /*#__PURE__*/S.optionalWith(BetaRequestCitationsConfig, {
|
|
@@ -946,7 +945,7 @@ class BetaInputMessage extends /*#__PURE__*/S.Struct({
|
|
|
946
945
|
}) {}
|
|
947
946
|
exports.BetaInputMessage = BetaInputMessage;
|
|
948
947
|
class BetaMetadata extends /*#__PURE__*/S.Struct({
|
|
949
|
-
"user_id": /*#__PURE__*/S.optionalWith(
|
|
948
|
+
"user_id": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.String.pipe(/*#__PURE__*/S.maxLength(256)), S.Null), {
|
|
950
949
|
nullable: true
|
|
951
950
|
})
|
|
952
951
|
}) {}
|
|
@@ -955,7 +954,7 @@ class BetaThinkingConfigEnabledType extends /*#__PURE__*/S.Literal("enabled") {}
|
|
|
955
954
|
exports.BetaThinkingConfigEnabledType = BetaThinkingConfigEnabledType;
|
|
956
955
|
class BetaThinkingConfigEnabled extends /*#__PURE__*/S.Struct({
|
|
957
956
|
"type": BetaThinkingConfigEnabledType,
|
|
958
|
-
"budget_tokens": /*#__PURE__*/S.Int.pipe(
|
|
957
|
+
"budget_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1024))
|
|
959
958
|
}) {}
|
|
960
959
|
exports.BetaThinkingConfigEnabled = BetaThinkingConfigEnabled;
|
|
961
960
|
class BetaThinkingConfigDisabledType extends /*#__PURE__*/S.Literal("disabled") {}
|
|
@@ -1008,7 +1007,7 @@ class BetaInputSchemaType extends /*#__PURE__*/S.Literal("object") {}
|
|
|
1008
1007
|
exports.BetaInputSchemaType = BetaInputSchemaType;
|
|
1009
1008
|
class BetaInputSchema extends /*#__PURE__*/S.Struct({
|
|
1010
1009
|
"type": BetaInputSchemaType,
|
|
1011
|
-
"properties": /*#__PURE__*/S.optionalWith(
|
|
1010
|
+
"properties": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Record({
|
|
1012
1011
|
key: S.String,
|
|
1013
1012
|
value: S.Unknown
|
|
1014
1013
|
}), S.Null), {
|
|
@@ -1017,15 +1016,15 @@ class BetaInputSchema extends /*#__PURE__*/S.Struct({
|
|
|
1017
1016
|
}) {}
|
|
1018
1017
|
exports.BetaInputSchema = BetaInputSchema;
|
|
1019
1018
|
class BetaTool extends /*#__PURE__*/S.Struct({
|
|
1020
|
-
"type": /*#__PURE__*/S.optionalWith(
|
|
1019
|
+
"type": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.Null, BetaToolTypeEnum), {
|
|
1021
1020
|
nullable: true
|
|
1022
1021
|
}),
|
|
1023
1022
|
"description": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1024
1023
|
nullable: true
|
|
1025
1024
|
}),
|
|
1026
|
-
"name": /*#__PURE__*/S.String.pipe(
|
|
1025
|
+
"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}$"))),
|
|
1027
1026
|
"input_schema": BetaInputSchema,
|
|
1028
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
1027
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1029
1028
|
nullable: true
|
|
1030
1029
|
})
|
|
1031
1030
|
}) {}
|
|
@@ -1035,14 +1034,14 @@ exports.BetaComputerUseTool20241022Type = BetaComputerUseTool20241022Type;
|
|
|
1035
1034
|
class BetaComputerUseTool20241022Name extends /*#__PURE__*/S.Literal("computer") {}
|
|
1036
1035
|
exports.BetaComputerUseTool20241022Name = BetaComputerUseTool20241022Name;
|
|
1037
1036
|
class BetaComputerUseTool20241022 extends /*#__PURE__*/S.Struct({
|
|
1038
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
1037
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1039
1038
|
nullable: true
|
|
1040
1039
|
}),
|
|
1041
1040
|
"type": BetaComputerUseTool20241022Type,
|
|
1042
1041
|
"name": BetaComputerUseTool20241022Name,
|
|
1043
|
-
"display_height_px": /*#__PURE__*/S.Int.pipe(
|
|
1044
|
-
"display_width_px": /*#__PURE__*/S.Int.pipe(
|
|
1045
|
-
"display_number": /*#__PURE__*/S.optionalWith(
|
|
1042
|
+
"display_height_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1043
|
+
"display_width_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1044
|
+
"display_number": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null), {
|
|
1046
1045
|
nullable: true
|
|
1047
1046
|
})
|
|
1048
1047
|
}) {}
|
|
@@ -1052,7 +1051,7 @@ exports.BetaBashTool20241022Type = BetaBashTool20241022Type;
|
|
|
1052
1051
|
class BetaBashTool20241022Name extends /*#__PURE__*/S.Literal("bash") {}
|
|
1053
1052
|
exports.BetaBashTool20241022Name = BetaBashTool20241022Name;
|
|
1054
1053
|
class BetaBashTool20241022 extends /*#__PURE__*/S.Struct({
|
|
1055
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
1054
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1056
1055
|
nullable: true
|
|
1057
1056
|
}),
|
|
1058
1057
|
"type": BetaBashTool20241022Type,
|
|
@@ -1064,7 +1063,7 @@ exports.BetaTextEditor20241022Type = BetaTextEditor20241022Type;
|
|
|
1064
1063
|
class BetaTextEditor20241022Name extends /*#__PURE__*/S.Literal("str_replace_editor") {}
|
|
1065
1064
|
exports.BetaTextEditor20241022Name = BetaTextEditor20241022Name;
|
|
1066
1065
|
class BetaTextEditor20241022 extends /*#__PURE__*/S.Struct({
|
|
1067
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
1066
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1068
1067
|
nullable: true
|
|
1069
1068
|
}),
|
|
1070
1069
|
"type": BetaTextEditor20241022Type,
|
|
@@ -1076,14 +1075,14 @@ exports.BetaComputerUseTool20250124Type = BetaComputerUseTool20250124Type;
|
|
|
1076
1075
|
class BetaComputerUseTool20250124Name extends /*#__PURE__*/S.Literal("computer") {}
|
|
1077
1076
|
exports.BetaComputerUseTool20250124Name = BetaComputerUseTool20250124Name;
|
|
1078
1077
|
class BetaComputerUseTool20250124 extends /*#__PURE__*/S.Struct({
|
|
1079
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
1078
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1080
1079
|
nullable: true
|
|
1081
1080
|
}),
|
|
1082
1081
|
"type": BetaComputerUseTool20250124Type,
|
|
1083
1082
|
"name": BetaComputerUseTool20250124Name,
|
|
1084
|
-
"display_height_px": /*#__PURE__*/S.Int.pipe(
|
|
1085
|
-
"display_width_px": /*#__PURE__*/S.Int.pipe(
|
|
1086
|
-
"display_number": /*#__PURE__*/S.optionalWith(
|
|
1083
|
+
"display_height_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1084
|
+
"display_width_px": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1085
|
+
"display_number": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null), {
|
|
1087
1086
|
nullable: true
|
|
1088
1087
|
})
|
|
1089
1088
|
}) {}
|
|
@@ -1093,7 +1092,7 @@ exports.BetaBashTool20250124Type = BetaBashTool20250124Type;
|
|
|
1093
1092
|
class BetaBashTool20250124Name extends /*#__PURE__*/S.Literal("bash") {}
|
|
1094
1093
|
exports.BetaBashTool20250124Name = BetaBashTool20250124Name;
|
|
1095
1094
|
class BetaBashTool20250124 extends /*#__PURE__*/S.Struct({
|
|
1096
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
1095
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1097
1096
|
nullable: true
|
|
1098
1097
|
}),
|
|
1099
1098
|
"type": BetaBashTool20250124Type,
|
|
@@ -1105,7 +1104,7 @@ exports.BetaTextEditor20250124Type = BetaTextEditor20250124Type;
|
|
|
1105
1104
|
class BetaTextEditor20250124Name extends /*#__PURE__*/S.Literal("str_replace_editor") {}
|
|
1106
1105
|
exports.BetaTextEditor20250124Name = BetaTextEditor20250124Name;
|
|
1107
1106
|
class BetaTextEditor20250124 extends /*#__PURE__*/S.Struct({
|
|
1108
|
-
"cache_control": /*#__PURE__*/S.optionalWith(
|
|
1107
|
+
"cache_control": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(BetaCacheControlEphemeral, S.Null), {
|
|
1109
1108
|
nullable: true
|
|
1110
1109
|
}),
|
|
1111
1110
|
"type": BetaTextEditor20250124Type,
|
|
@@ -1115,20 +1114,20 @@ exports.BetaTextEditor20250124 = BetaTextEditor20250124;
|
|
|
1115
1114
|
class BetaCreateMessageParams extends /*#__PURE__*/S.Class("BetaCreateMessageParams")({
|
|
1116
1115
|
"model": Model,
|
|
1117
1116
|
"messages": /*#__PURE__*/S.Array(BetaInputMessage),
|
|
1118
|
-
"max_tokens": /*#__PURE__*/S.Int.pipe(
|
|
1117
|
+
"max_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1119
1118
|
"metadata": /*#__PURE__*/S.optionalWith(BetaMetadata, {
|
|
1120
1119
|
nullable: true
|
|
1121
1120
|
}),
|
|
1122
|
-
"stop_sequences": /*#__PURE__*/S.optionalWith(
|
|
1121
|
+
"stop_sequences": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(S.String), {
|
|
1123
1122
|
nullable: true
|
|
1124
1123
|
}),
|
|
1125
1124
|
"stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
|
|
1126
1125
|
nullable: true
|
|
1127
1126
|
}),
|
|
1128
|
-
"system": /*#__PURE__*/S.optionalWith(
|
|
1127
|
+
"system": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaRequestTextBlock)), {
|
|
1129
1128
|
nullable: true
|
|
1130
1129
|
}),
|
|
1131
|
-
"temperature": /*#__PURE__*/S.optionalWith(
|
|
1130
|
+
"temperature": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Number.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
|
|
1132
1131
|
nullable: true
|
|
1133
1132
|
}),
|
|
1134
1133
|
"thinking": /*#__PURE__*/S.optionalWith(BetaThinkingConfigParam, {
|
|
@@ -1137,13 +1136,13 @@ class BetaCreateMessageParams extends /*#__PURE__*/S.Class("BetaCreateMessagePar
|
|
|
1137
1136
|
"tool_choice": /*#__PURE__*/S.optionalWith(BetaToolChoice, {
|
|
1138
1137
|
nullable: true
|
|
1139
1138
|
}),
|
|
1140
|
-
"tools": /*#__PURE__*/S.optionalWith(
|
|
1139
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022, BetaComputerUseTool20250124, BetaBashTool20250124, BetaTextEditor20250124)), {
|
|
1141
1140
|
nullable: true
|
|
1142
1141
|
}),
|
|
1143
|
-
"top_k": /*#__PURE__*/S.optionalWith(
|
|
1142
|
+
"top_k": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), {
|
|
1144
1143
|
nullable: true
|
|
1145
1144
|
}),
|
|
1146
|
-
"top_p": /*#__PURE__*/S.optionalWith(
|
|
1145
|
+
"top_p": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Number.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
|
|
1147
1146
|
nullable: true
|
|
1148
1147
|
})
|
|
1149
1148
|
}) {}
|
|
@@ -1159,9 +1158,9 @@ exports.BetaResponseCharLocationCitationType = BetaResponseCharLocationCitationT
|
|
|
1159
1158
|
class BetaResponseCharLocationCitation extends /*#__PURE__*/S.Struct({
|
|
1160
1159
|
"type": /*#__PURE__*/BetaResponseCharLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "char_location")),
|
|
1161
1160
|
"cited_text": S.String,
|
|
1162
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
1161
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1163
1162
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1164
|
-
"start_char_index": /*#__PURE__*/S.Int.pipe(
|
|
1163
|
+
"start_char_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1165
1164
|
"end_char_index": S.Int
|
|
1166
1165
|
}) {}
|
|
1167
1166
|
exports.BetaResponseCharLocationCitation = BetaResponseCharLocationCitation;
|
|
@@ -1170,9 +1169,9 @@ exports.BetaResponsePageLocationCitationType = BetaResponsePageLocationCitationT
|
|
|
1170
1169
|
class BetaResponsePageLocationCitation extends /*#__PURE__*/S.Struct({
|
|
1171
1170
|
"type": /*#__PURE__*/BetaResponsePageLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "page_location")),
|
|
1172
1171
|
"cited_text": S.String,
|
|
1173
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
1172
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1174
1173
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1175
|
-
"start_page_number": /*#__PURE__*/S.Int.pipe(
|
|
1174
|
+
"start_page_number": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1)),
|
|
1176
1175
|
"end_page_number": S.Int
|
|
1177
1176
|
}) {}
|
|
1178
1177
|
exports.BetaResponsePageLocationCitation = BetaResponsePageLocationCitation;
|
|
@@ -1181,16 +1180,16 @@ exports.BetaResponseContentBlockLocationCitationType = BetaResponseContentBlockL
|
|
|
1181
1180
|
class BetaResponseContentBlockLocationCitation extends /*#__PURE__*/S.Struct({
|
|
1182
1181
|
"type": /*#__PURE__*/BetaResponseContentBlockLocationCitationType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "content_block_location")),
|
|
1183
1182
|
"cited_text": S.String,
|
|
1184
|
-
"document_index": /*#__PURE__*/S.Int.pipe(
|
|
1183
|
+
"document_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1185
1184
|
"document_title": /*#__PURE__*/S.Union(S.String, S.Null),
|
|
1186
|
-
"start_block_index": /*#__PURE__*/S.Int.pipe(
|
|
1185
|
+
"start_block_index": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1187
1186
|
"end_block_index": S.Int
|
|
1188
1187
|
}) {}
|
|
1189
1188
|
exports.BetaResponseContentBlockLocationCitation = BetaResponseContentBlockLocationCitation;
|
|
1190
1189
|
class BetaResponseTextBlock extends /*#__PURE__*/S.Struct({
|
|
1191
1190
|
"type": /*#__PURE__*/BetaResponseTextBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "text")),
|
|
1192
|
-
"text": /*#__PURE__*/S.String.pipe(
|
|
1193
|
-
"citations": /*#__PURE__*/S.optionalWith(
|
|
1191
|
+
"text": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(0), /*#__PURE__*/S.maxLength(5000000)),
|
|
1192
|
+
"citations": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaResponseCharLocationCitation, BetaResponsePageLocationCitation, BetaResponseContentBlockLocationCitation)), S.Null)), {
|
|
1194
1193
|
default: () => null
|
|
1195
1194
|
})
|
|
1196
1195
|
}) {}
|
|
@@ -1199,8 +1198,8 @@ class BetaResponseToolUseBlockType extends /*#__PURE__*/S.Literal("tool_use") {}
|
|
|
1199
1198
|
exports.BetaResponseToolUseBlockType = BetaResponseToolUseBlockType;
|
|
1200
1199
|
class BetaResponseToolUseBlock extends /*#__PURE__*/S.Struct({
|
|
1201
1200
|
"type": /*#__PURE__*/BetaResponseToolUseBlockType.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "tool_use")),
|
|
1202
|
-
"id": /*#__PURE__*/S.String.pipe(
|
|
1203
|
-
"name": /*#__PURE__*/S.String.pipe(
|
|
1201
|
+
"id": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.pattern(/*#__PURE__*/new RegExp("^[a-zA-Z0-9_-]+$"))),
|
|
1202
|
+
"name": /*#__PURE__*/S.String.pipe(/*#__PURE__*/S.minLength(1)),
|
|
1204
1203
|
"input": /*#__PURE__*/S.Record({
|
|
1205
1204
|
key: S.String,
|
|
1206
1205
|
value: S.Unknown
|
|
@@ -1227,14 +1226,14 @@ exports.BetaContentBlock = BetaContentBlock;
|
|
|
1227
1226
|
class BetaMessageStopReasonEnum extends /*#__PURE__*/S.Literal("end_turn", "max_tokens", "stop_sequence", "tool_use") {}
|
|
1228
1227
|
exports.BetaMessageStopReasonEnum = BetaMessageStopReasonEnum;
|
|
1229
1228
|
class BetaUsage extends /*#__PURE__*/S.Struct({
|
|
1230
|
-
"input_tokens": /*#__PURE__*/S.Int.pipe(
|
|
1231
|
-
"cache_creation_input_tokens": /*#__PURE__*/S.optionalWith(
|
|
1229
|
+
"input_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)),
|
|
1230
|
+
"cache_creation_input_tokens": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
|
|
1232
1231
|
default: () => null
|
|
1233
1232
|
}),
|
|
1234
|
-
"cache_read_input_tokens": /*#__PURE__*/S.optionalWith(
|
|
1233
|
+
"cache_read_input_tokens": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0)), S.Null)), {
|
|
1235
1234
|
default: () => null
|
|
1236
1235
|
}),
|
|
1237
|
-
"output_tokens": /*#__PURE__*/S.Int.pipe(
|
|
1236
|
+
"output_tokens": /*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(0))
|
|
1238
1237
|
}) {}
|
|
1239
1238
|
exports.BetaUsage = BetaUsage;
|
|
1240
1239
|
class BetaMessage extends /*#__PURE__*/S.Class("BetaMessage")({
|
|
@@ -1244,7 +1243,7 @@ class BetaMessage extends /*#__PURE__*/S.Class("BetaMessage")({
|
|
|
1244
1243
|
"content": /*#__PURE__*/S.Array(BetaContentBlock),
|
|
1245
1244
|
"model": Model,
|
|
1246
1245
|
"stop_reason": /*#__PURE__*/S.Union(BetaMessageStopReasonEnum, S.Null),
|
|
1247
|
-
"stop_sequence": /*#__PURE__*/S.optionalWith(
|
|
1246
|
+
"stop_sequence": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.NullOr(/*#__PURE__*/S.Union(S.String, S.Null)), {
|
|
1248
1247
|
default: () => null
|
|
1249
1248
|
}),
|
|
1250
1249
|
"usage": BetaUsage
|
|
@@ -1327,7 +1326,7 @@ class BetaModelsListParams extends /*#__PURE__*/S.Struct({
|
|
|
1327
1326
|
"after_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1328
1327
|
nullable: true
|
|
1329
1328
|
}),
|
|
1330
|
-
"limit": /*#__PURE__*/S.optionalWith(
|
|
1329
|
+
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
1331
1330
|
nullable: true,
|
|
1332
1331
|
default: () => 20
|
|
1333
1332
|
}),
|
|
@@ -1371,7 +1370,7 @@ class BetaMessageBatchesListParams extends /*#__PURE__*/S.Struct({
|
|
|
1371
1370
|
"after_id": /*#__PURE__*/S.optionalWith(S.String, {
|
|
1372
1371
|
nullable: true
|
|
1373
1372
|
}),
|
|
1374
|
-
"limit": /*#__PURE__*/S.optionalWith(
|
|
1373
|
+
"limit": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Int.pipe(/*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(1000)), {
|
|
1375
1374
|
nullable: true,
|
|
1376
1375
|
default: () => 20
|
|
1377
1376
|
}),
|
|
@@ -1428,12 +1427,12 @@ class BetaMessageBatchesPostParams extends /*#__PURE__*/S.Struct({
|
|
|
1428
1427
|
}) {}
|
|
1429
1428
|
exports.BetaMessageBatchesPostParams = BetaMessageBatchesPostParams;
|
|
1430
1429
|
class BetaMessageBatchIndividualRequestParams extends /*#__PURE__*/S.Struct({
|
|
1431
|
-
"custom_id": /*#__PURE__*/S.String.pipe(
|
|
1430
|
+
"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}$"))),
|
|
1432
1431
|
"params": BetaCreateMessageParams
|
|
1433
1432
|
}) {}
|
|
1434
1433
|
exports.BetaMessageBatchIndividualRequestParams = BetaMessageBatchIndividualRequestParams;
|
|
1435
1434
|
class BetaCreateMessageBatchParams extends /*#__PURE__*/S.Class("BetaCreateMessageBatchParams")({
|
|
1436
|
-
"requests": /*#__PURE__*/S.Array(BetaMessageBatchIndividualRequestParams).pipe(
|
|
1435
|
+
"requests": /*#__PURE__*/S.Array(BetaMessageBatchIndividualRequestParams).pipe(/*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(10000))
|
|
1437
1436
|
}) {}
|
|
1438
1437
|
exports.BetaCreateMessageBatchParams = BetaCreateMessageBatchParams;
|
|
1439
1438
|
class BetaMessageBatchesRetrieveParams extends /*#__PURE__*/S.Struct({
|
|
@@ -1501,11 +1500,11 @@ class BetaCountMessageTokensParams extends /*#__PURE__*/S.Class("BetaCountMessag
|
|
|
1501
1500
|
"tool_choice": /*#__PURE__*/S.optionalWith(BetaToolChoice, {
|
|
1502
1501
|
nullable: true
|
|
1503
1502
|
}),
|
|
1504
|
-
"tools": /*#__PURE__*/S.optionalWith(
|
|
1503
|
+
"tools": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Array(/*#__PURE__*/S.Union(BetaTool, BetaComputerUseTool20241022, BetaBashTool20241022, BetaTextEditor20241022, BetaComputerUseTool20250124, BetaBashTool20250124, BetaTextEditor20250124)), {
|
|
1505
1504
|
nullable: true
|
|
1506
1505
|
}),
|
|
1507
1506
|
"messages": /*#__PURE__*/S.Array(BetaInputMessage),
|
|
1508
|
-
"system": /*#__PURE__*/S.optionalWith(
|
|
1507
|
+
"system": /*#__PURE__*/S.optionalWith(/*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(BetaRequestTextBlock)), {
|
|
1509
1508
|
nullable: true
|
|
1510
1509
|
}),
|
|
1511
1510
|
"thinking": /*#__PURE__*/S.optionalWith(BetaThinkingConfigParam, {
|