@anthropic-ai/sdk 0.28.0 → 0.29.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/CHANGELOG.md +35 -0
- package/README.md +76 -0
- package/core.d.ts +1 -1
- package/core.d.ts.map +1 -1
- package/core.js +1 -1
- package/core.js.map +1 -1
- package/core.mjs +1 -1
- package/core.mjs.map +1 -1
- package/index.d.mts +19 -0
- package/index.d.ts +19 -0
- package/index.d.ts.map +1 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/index.mjs +2 -0
- package/index.mjs.map +1 -1
- package/internal/decoders/jsonl.d.ts +12 -0
- package/internal/decoders/jsonl.d.ts.map +1 -0
- package/internal/decoders/jsonl.js +35 -0
- package/internal/decoders/jsonl.js.map +1 -0
- package/internal/decoders/jsonl.mjs +31 -0
- package/internal/decoders/jsonl.mjs.map +1 -0
- package/internal/decoders/line.d.ts +20 -0
- package/internal/decoders/line.d.ts.map +1 -0
- package/internal/decoders/line.js +88 -0
- package/internal/decoders/line.js.map +1 -0
- package/internal/decoders/line.mjs +84 -0
- package/internal/decoders/line.mjs.map +1 -0
- package/package.json +1 -1
- package/pagination.d.ts +26 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +54 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +50 -0
- package/pagination.mjs.map +1 -0
- package/resources/beta/beta.d.ts +79 -0
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +3 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +3 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.ts +2 -1
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +5 -3
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +2 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/messages/batches.d.ts +242 -0
- package/resources/beta/messages/batches.d.ts.map +1 -0
- package/resources/beta/messages/batches.js +120 -0
- package/resources/beta/messages/batches.js.map +1 -0
- package/resources/beta/messages/batches.mjs +92 -0
- package/resources/beta/messages/batches.mjs.map +1 -0
- package/resources/beta/messages/index.d.ts +3 -0
- package/resources/beta/messages/index.d.ts.map +1 -0
- package/resources/beta/messages/index.js +10 -0
- package/resources/beta/messages/index.js.map +1 -0
- package/resources/beta/messages/index.mjs +4 -0
- package/resources/beta/messages/index.mjs.map +1 -0
- package/resources/beta/messages/messages.d.ts +663 -0
- package/resources/beta/messages/messages.d.ts.map +1 -0
- package/resources/beta/messages/messages.js +54 -0
- package/resources/beta/messages/messages.js.map +1 -0
- package/resources/beta/messages/messages.mjs +27 -0
- package/resources/beta/messages/messages.mjs.map +1 -0
- package/resources/beta/prompt-caching/messages.d.ts +40 -74
- package/resources/beta/prompt-caching/messages.d.ts.map +1 -1
- package/resources/beta/prompt-caching/messages.js +7 -3
- package/resources/beta/prompt-caching/messages.js.map +1 -1
- package/resources/beta/prompt-caching/messages.mjs +7 -3
- package/resources/beta/prompt-caching/messages.mjs.map +1 -1
- package/resources/completions.d.ts +3 -12
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/messages.d.ts +76 -55
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs.map +1 -1
- package/src/core.ts +4 -2
- package/src/index.ts +20 -0
- package/src/internal/decoders/jsonl.ts +41 -0
- package/src/internal/decoders/line.ts +114 -0
- package/src/pagination.ts +84 -0
- package/src/resources/beta/beta.ts +104 -0
- package/src/resources/beta/index.ts +47 -1
- package/src/resources/beta/messages/batches.ts +393 -0
- package/src/resources/beta/messages/index.ts +53 -0
- package/src/resources/beta/messages/messages.ts +795 -0
- package/src/resources/beta/prompt-caching/messages.ts +45 -81
- package/src/resources/completions.ts +3 -12
- package/src/resources/index.ts +18 -1
- package/src/resources/messages.ts +82 -59
- package/src/streaming.ts +1 -111
- package/src/version.ts +1 -1
- package/streaming.d.ts.map +1 -1
- package/streaming.js +4 -85
- package/streaming.js.map +1 -1
- package/streaming.mjs +1 -82
- package/streaming.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export {
|
|
4
|
+
AnthropicBeta,
|
|
5
|
+
BetaAPIError,
|
|
6
|
+
BetaAuthenticationError,
|
|
7
|
+
BetaError,
|
|
8
|
+
BetaErrorResponse,
|
|
9
|
+
BetaInvalidRequestError,
|
|
10
|
+
BetaNotFoundError,
|
|
11
|
+
BetaOverloadedError,
|
|
12
|
+
BetaPermissionError,
|
|
13
|
+
BetaRateLimitError,
|
|
14
|
+
Beta,
|
|
15
|
+
} from "./beta.js";
|
|
16
|
+
export {
|
|
17
|
+
BetaCacheControlEphemeral,
|
|
18
|
+
BetaContentBlock,
|
|
19
|
+
BetaContentBlockParam,
|
|
20
|
+
BetaImageBlockParam,
|
|
21
|
+
BetaInputJSONDelta,
|
|
22
|
+
BetaMessage,
|
|
23
|
+
BetaMessageDeltaUsage,
|
|
24
|
+
BetaMessageParam,
|
|
25
|
+
BetaMetadata,
|
|
26
|
+
BetaRawContentBlockDeltaEvent,
|
|
27
|
+
BetaRawContentBlockStartEvent,
|
|
28
|
+
BetaRawContentBlockStopEvent,
|
|
29
|
+
BetaRawMessageDeltaEvent,
|
|
30
|
+
BetaRawMessageStartEvent,
|
|
31
|
+
BetaRawMessageStopEvent,
|
|
32
|
+
BetaRawMessageStreamEvent,
|
|
33
|
+
BetaTextBlock,
|
|
34
|
+
BetaTextBlockParam,
|
|
35
|
+
BetaTextDelta,
|
|
36
|
+
BetaTool,
|
|
37
|
+
BetaToolChoice,
|
|
38
|
+
BetaToolChoiceAny,
|
|
39
|
+
BetaToolChoiceAuto,
|
|
40
|
+
BetaToolChoiceTool,
|
|
41
|
+
BetaToolResultBlockParam,
|
|
42
|
+
BetaToolUseBlock,
|
|
43
|
+
BetaToolUseBlockParam,
|
|
44
|
+
BetaUsage,
|
|
45
|
+
MessageCreateParams,
|
|
46
|
+
MessageCreateParamsNonStreaming,
|
|
47
|
+
MessageCreateParamsStreaming,
|
|
48
|
+
Messages,
|
|
49
|
+
} from "./messages/index.js";
|
|
4
50
|
export { PromptCaching } from "./prompt-caching/index.js";
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from "../../../resource.js";
|
|
4
|
+
import { isRequestOptions } from "../../../core.js";
|
|
5
|
+
import * as Core from "../../../core.js";
|
|
6
|
+
import * as BatchesAPI from "./batches.js";
|
|
7
|
+
import * as BetaAPI from "../beta.js";
|
|
8
|
+
import * as BetaMessagesAPI from "./messages.js";
|
|
9
|
+
import { Page, type PageParams } from "../../../pagination.js";
|
|
10
|
+
import { JSONLDecoder } from "../../../internal/decoders/jsonl.js";
|
|
11
|
+
import { AnthropicError } from "../../../error.js";
|
|
12
|
+
|
|
13
|
+
export class Batches extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Send a batch of requests to create Messages.
|
|
16
|
+
*
|
|
17
|
+
* The Messages Batch API can be used to process multiple Messages API requests at
|
|
18
|
+
* once. Once a Message Batch is created, it begins processing immediately.
|
|
19
|
+
*/
|
|
20
|
+
create(params: BatchCreateParams, options?: Core.RequestOptions): Core.APIPromise<BetaMessageBatch> {
|
|
21
|
+
const { betas, ...body } = params;
|
|
22
|
+
return this._client.post('/v1/messages/batches?beta=true', {
|
|
23
|
+
body,
|
|
24
|
+
...options,
|
|
25
|
+
headers: {
|
|
26
|
+
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
|
|
27
|
+
...options?.headers,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This endpoint is idempotent and can be used to poll for Message Batch
|
|
34
|
+
* completion. To access the results of a Message Batch, use the `responses_url`
|
|
35
|
+
* field in the response.
|
|
36
|
+
*/
|
|
37
|
+
retrieve(
|
|
38
|
+
messageBatchId: string,
|
|
39
|
+
params?: BatchRetrieveParams,
|
|
40
|
+
options?: Core.RequestOptions,
|
|
41
|
+
): Core.APIPromise<BetaMessageBatch>;
|
|
42
|
+
retrieve(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<BetaMessageBatch>;
|
|
43
|
+
retrieve(
|
|
44
|
+
messageBatchId: string,
|
|
45
|
+
params: BatchRetrieveParams | Core.RequestOptions = {},
|
|
46
|
+
options?: Core.RequestOptions,
|
|
47
|
+
): Core.APIPromise<BetaMessageBatch> {
|
|
48
|
+
if (isRequestOptions(params)) {
|
|
49
|
+
return this.retrieve(messageBatchId, {}, params);
|
|
50
|
+
}
|
|
51
|
+
const { betas } = params;
|
|
52
|
+
return this._client.get(`/v1/messages/batches/${messageBatchId}?beta=true`, {
|
|
53
|
+
...options,
|
|
54
|
+
headers: {
|
|
55
|
+
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
|
|
56
|
+
...options?.headers,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* List all Message Batches within a Workspace.
|
|
63
|
+
*/
|
|
64
|
+
list(
|
|
65
|
+
params?: BatchListParams,
|
|
66
|
+
options?: Core.RequestOptions,
|
|
67
|
+
): Core.PagePromise<BetaMessageBatchesPage, BetaMessageBatch>;
|
|
68
|
+
list(options?: Core.RequestOptions): Core.PagePromise<BetaMessageBatchesPage, BetaMessageBatch>;
|
|
69
|
+
list(
|
|
70
|
+
params: BatchListParams | Core.RequestOptions = {},
|
|
71
|
+
options?: Core.RequestOptions,
|
|
72
|
+
): Core.PagePromise<BetaMessageBatchesPage, BetaMessageBatch> {
|
|
73
|
+
if (isRequestOptions(params)) {
|
|
74
|
+
return this.list({}, params);
|
|
75
|
+
}
|
|
76
|
+
const { betas, ...query } = params;
|
|
77
|
+
return this._client.getAPIList('/v1/messages/batches?beta=true', BetaMessageBatchesPage, {
|
|
78
|
+
query,
|
|
79
|
+
...options,
|
|
80
|
+
headers: {
|
|
81
|
+
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
|
|
82
|
+
...options?.headers,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Batches may be canceled any time before processing ends. The system may complete
|
|
89
|
+
* any in-progress, non-interruptible operations before finalizing cancellation.
|
|
90
|
+
*/
|
|
91
|
+
cancel(
|
|
92
|
+
messageBatchId: string,
|
|
93
|
+
params?: BatchCancelParams,
|
|
94
|
+
options?: Core.RequestOptions,
|
|
95
|
+
): Core.APIPromise<BetaMessageBatch>;
|
|
96
|
+
cancel(messageBatchId: string, options?: Core.RequestOptions): Core.APIPromise<BetaMessageBatch>;
|
|
97
|
+
cancel(
|
|
98
|
+
messageBatchId: string,
|
|
99
|
+
params: BatchCancelParams | Core.RequestOptions = {},
|
|
100
|
+
options?: Core.RequestOptions,
|
|
101
|
+
): Core.APIPromise<BetaMessageBatch> {
|
|
102
|
+
if (isRequestOptions(params)) {
|
|
103
|
+
return this.cancel(messageBatchId, {}, params);
|
|
104
|
+
}
|
|
105
|
+
const { betas } = params;
|
|
106
|
+
return this._client.post(`/v1/messages/batches/${messageBatchId}/cancel?beta=true`, {
|
|
107
|
+
...options,
|
|
108
|
+
headers: {
|
|
109
|
+
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
|
|
110
|
+
...options?.headers,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Streams the results of a Message Batch as a `.jsonl` file.
|
|
117
|
+
*
|
|
118
|
+
* Each line in the file is a JSON object containing the result of a single request
|
|
119
|
+
* in the Message Batch. Results are not guaranteed to be in the same order as
|
|
120
|
+
* requests. Use the `custom_id` field to match results to requests.
|
|
121
|
+
*/
|
|
122
|
+
async results(
|
|
123
|
+
messageBatchId: string,
|
|
124
|
+
params?: BatchResultsParams,
|
|
125
|
+
options?: Core.RequestOptions,
|
|
126
|
+
): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>>;
|
|
127
|
+
async results(
|
|
128
|
+
messageBatchId: string,
|
|
129
|
+
options?: Core.RequestOptions,
|
|
130
|
+
): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>>;
|
|
131
|
+
async results(
|
|
132
|
+
messageBatchId: string,
|
|
133
|
+
params: BatchResultsParams | Core.RequestOptions = {},
|
|
134
|
+
options?: Core.RequestOptions,
|
|
135
|
+
): Promise<JSONLDecoder<BetaMessageBatchIndividualResponse>> {
|
|
136
|
+
if (isRequestOptions(params)) {
|
|
137
|
+
return this.results(messageBatchId, {}, params);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const batch = await this.retrieve(messageBatchId);
|
|
141
|
+
if (!batch.results_url) {
|
|
142
|
+
throw new AnthropicError(
|
|
143
|
+
`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const { betas } = params;
|
|
148
|
+
return this._client
|
|
149
|
+
.get(batch.results_url, {
|
|
150
|
+
...options,
|
|
151
|
+
headers: {
|
|
152
|
+
'anthropic-beta': [...(betas ?? []), 'message-batches-2024-09-24'].toString(),
|
|
153
|
+
...options?.headers,
|
|
154
|
+
},
|
|
155
|
+
__binaryResponse: true,
|
|
156
|
+
})
|
|
157
|
+
._thenUnwrap((_, props) => JSONLDecoder.fromResponse(props.response, props.controller));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export class BetaMessageBatchesPage extends Page<BetaMessageBatch> {}
|
|
162
|
+
|
|
163
|
+
export interface BetaMessageBatch {
|
|
164
|
+
/**
|
|
165
|
+
* Unique object identifier.
|
|
166
|
+
*
|
|
167
|
+
* The format and length of IDs may change over time.
|
|
168
|
+
*/
|
|
169
|
+
id: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* RFC 3339 datetime string representing the time at which cancellation was
|
|
173
|
+
* initiated for the Message Batch. Specified only if cancellation was initiated.
|
|
174
|
+
*/
|
|
175
|
+
cancel_initiated_at: string | null;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* RFC 3339 datetime string representing the time at which the Message Batch was
|
|
179
|
+
* created.
|
|
180
|
+
*/
|
|
181
|
+
created_at: string;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* RFC 3339 datetime string representing the time at which processing for the
|
|
185
|
+
* Message Batch ended. Specified only once processing ends.
|
|
186
|
+
*
|
|
187
|
+
* Processing ends when every request in a Message Batch has either succeeded,
|
|
188
|
+
* errored, canceled, or expired.
|
|
189
|
+
*/
|
|
190
|
+
ended_at: string | null;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* RFC 3339 datetime string representing the time at which the Message Batch will
|
|
194
|
+
* expire and end processing, which is 24 hours after creation.
|
|
195
|
+
*/
|
|
196
|
+
expires_at: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Processing status of the Message Batch.
|
|
200
|
+
*
|
|
201
|
+
* This is one of: `in_progress`, `canceling`, or `ended`.
|
|
202
|
+
*/
|
|
203
|
+
processing_status: 'in_progress' | 'canceling' | 'ended';
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Overview of the number of requests within the Message Batch and their statuses.
|
|
207
|
+
*
|
|
208
|
+
* Requests start as `processing` and move to one of the other statuses only once
|
|
209
|
+
* processing of entire batch ends.
|
|
210
|
+
*/
|
|
211
|
+
request_counts: BetaMessageBatchRequestCounts;
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* URL to a `.jsonl` file containing the results of the Message Batch requests.
|
|
215
|
+
* Specified only once processing ends.
|
|
216
|
+
*
|
|
217
|
+
* Results in the file are not guaranteed to be in the same order as requests. Use
|
|
218
|
+
* the `custom_id` field to match results to requests.
|
|
219
|
+
*/
|
|
220
|
+
results_url: string | null;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Object type.
|
|
224
|
+
*
|
|
225
|
+
* For Message Batches, this is always `"message_batch"`.
|
|
226
|
+
*/
|
|
227
|
+
type: 'message_batch';
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export interface BetaMessageBatchCanceledResult {
|
|
231
|
+
type: 'canceled';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export interface BetaMessageBatchErroredResult {
|
|
235
|
+
error: BetaAPI.BetaErrorResponse;
|
|
236
|
+
|
|
237
|
+
type: 'errored';
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export interface BetaMessageBatchExpiredResult {
|
|
241
|
+
type: 'expired';
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export interface BetaMessageBatchIndividualResponse {
|
|
245
|
+
/**
|
|
246
|
+
* Developer-provided ID created for each request in a Message Batch. Useful for
|
|
247
|
+
* matching results to requests.
|
|
248
|
+
*
|
|
249
|
+
* Must be unique for each request within the Message Batch.
|
|
250
|
+
*/
|
|
251
|
+
custom_id: string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Processing result for this request.
|
|
255
|
+
*
|
|
256
|
+
* Contains a Message output if processing was successful, an error response if
|
|
257
|
+
* processing failed, or the reason why processing was not attempted, such as
|
|
258
|
+
* cancellation or expiration.
|
|
259
|
+
*/
|
|
260
|
+
result: BetaMessageBatchResult;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export interface BetaMessageBatchRequestCounts {
|
|
264
|
+
/**
|
|
265
|
+
* Number of requests in the Message Batch that have been canceled.
|
|
266
|
+
*
|
|
267
|
+
* This is zero until processing of the entire Message Batch has ended.
|
|
268
|
+
*/
|
|
269
|
+
canceled: number;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Number of requests in the Message Batch that encountered an error.
|
|
273
|
+
*
|
|
274
|
+
* This is zero until processing of the entire Message Batch has ended.
|
|
275
|
+
*/
|
|
276
|
+
errored: number;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Number of requests in the Message Batch that have expired.
|
|
280
|
+
*
|
|
281
|
+
* This is zero until processing of the entire Message Batch has ended.
|
|
282
|
+
*/
|
|
283
|
+
expired: number;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Number of requests in the Message Batch that are processing.
|
|
287
|
+
*/
|
|
288
|
+
processing: number;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Number of requests in the Message Batch that have completed successfully.
|
|
292
|
+
*
|
|
293
|
+
* This is zero until processing of the entire Message Batch has ended.
|
|
294
|
+
*/
|
|
295
|
+
succeeded: number;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Processing result for this request.
|
|
300
|
+
*
|
|
301
|
+
* Contains a Message output if processing was successful, an error response if
|
|
302
|
+
* processing failed, or the reason why processing was not attempted, such as
|
|
303
|
+
* cancellation or expiration.
|
|
304
|
+
*/
|
|
305
|
+
export type BetaMessageBatchResult =
|
|
306
|
+
| BetaMessageBatchSucceededResult
|
|
307
|
+
| BetaMessageBatchErroredResult
|
|
308
|
+
| BetaMessageBatchCanceledResult
|
|
309
|
+
| BetaMessageBatchExpiredResult;
|
|
310
|
+
|
|
311
|
+
export interface BetaMessageBatchSucceededResult {
|
|
312
|
+
message: BetaMessagesAPI.BetaMessage;
|
|
313
|
+
|
|
314
|
+
type: 'succeeded';
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export interface BatchCreateParams {
|
|
318
|
+
/**
|
|
319
|
+
* Body param: List of requests for prompt completion. Each is an individual
|
|
320
|
+
* request to create a Message.
|
|
321
|
+
*/
|
|
322
|
+
requests: Array<BatchCreateParams.Request>;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
326
|
+
*/
|
|
327
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export namespace BatchCreateParams {
|
|
331
|
+
export interface Request {
|
|
332
|
+
/**
|
|
333
|
+
* Developer-provided ID created for each request in a Message Batch. Useful for
|
|
334
|
+
* matching results to requests.
|
|
335
|
+
*
|
|
336
|
+
* Must be unique for each request within the Message Batch.
|
|
337
|
+
*/
|
|
338
|
+
custom_id: string;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Messages API creation parameters for the individual request.
|
|
342
|
+
*
|
|
343
|
+
* See the [Messages API reference](/en/api/messages) for full documentation on
|
|
344
|
+
* available parameters.
|
|
345
|
+
*/
|
|
346
|
+
params: BetaMessagesAPI.MessageCreateParamsNonStreaming;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export interface BatchRetrieveParams {
|
|
351
|
+
/**
|
|
352
|
+
* Optional header to specify the beta version(s) you want to use.
|
|
353
|
+
*/
|
|
354
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export interface BatchListParams extends PageParams {
|
|
358
|
+
/**
|
|
359
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
360
|
+
*/
|
|
361
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export interface BatchCancelParams {
|
|
365
|
+
/**
|
|
366
|
+
* Optional header to specify the beta version(s) you want to use.
|
|
367
|
+
*/
|
|
368
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
export interface BatchResultsParams {
|
|
372
|
+
/**
|
|
373
|
+
* Optional header to specify the beta version(s) you want to use.
|
|
374
|
+
*/
|
|
375
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
export namespace Batches {
|
|
379
|
+
export import BetaMessageBatch = BatchesAPI.BetaMessageBatch;
|
|
380
|
+
export import BetaMessageBatchCanceledResult = BatchesAPI.BetaMessageBatchCanceledResult;
|
|
381
|
+
export import BetaMessageBatchErroredResult = BatchesAPI.BetaMessageBatchErroredResult;
|
|
382
|
+
export import BetaMessageBatchExpiredResult = BatchesAPI.BetaMessageBatchExpiredResult;
|
|
383
|
+
export import BetaMessageBatchIndividualResponse = BatchesAPI.BetaMessageBatchIndividualResponse;
|
|
384
|
+
export import BetaMessageBatchRequestCounts = BatchesAPI.BetaMessageBatchRequestCounts;
|
|
385
|
+
export import BetaMessageBatchResult = BatchesAPI.BetaMessageBatchResult;
|
|
386
|
+
export import BetaMessageBatchSucceededResult = BatchesAPI.BetaMessageBatchSucceededResult;
|
|
387
|
+
export import BetaMessageBatchesPage = BatchesAPI.BetaMessageBatchesPage;
|
|
388
|
+
export import BatchCreateParams = BatchesAPI.BatchCreateParams;
|
|
389
|
+
export import BatchRetrieveParams = BatchesAPI.BatchRetrieveParams;
|
|
390
|
+
export import BatchListParams = BatchesAPI.BatchListParams;
|
|
391
|
+
export import BatchCancelParams = BatchesAPI.BatchCancelParams;
|
|
392
|
+
export import BatchResultsParams = BatchesAPI.BatchResultsParams;
|
|
393
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
BetaCacheControlEphemeral,
|
|
5
|
+
BetaContentBlock,
|
|
6
|
+
BetaContentBlockParam,
|
|
7
|
+
BetaImageBlockParam,
|
|
8
|
+
BetaInputJSONDelta,
|
|
9
|
+
BetaMessage,
|
|
10
|
+
BetaMessageDeltaUsage,
|
|
11
|
+
BetaMessageParam,
|
|
12
|
+
BetaMetadata,
|
|
13
|
+
BetaRawContentBlockDeltaEvent,
|
|
14
|
+
BetaRawContentBlockStartEvent,
|
|
15
|
+
BetaRawContentBlockStopEvent,
|
|
16
|
+
BetaRawMessageDeltaEvent,
|
|
17
|
+
BetaRawMessageStartEvent,
|
|
18
|
+
BetaRawMessageStopEvent,
|
|
19
|
+
BetaRawMessageStreamEvent,
|
|
20
|
+
BetaTextBlock,
|
|
21
|
+
BetaTextBlockParam,
|
|
22
|
+
BetaTextDelta,
|
|
23
|
+
BetaTool,
|
|
24
|
+
BetaToolChoice,
|
|
25
|
+
BetaToolChoiceAny,
|
|
26
|
+
BetaToolChoiceAuto,
|
|
27
|
+
BetaToolChoiceTool,
|
|
28
|
+
BetaToolResultBlockParam,
|
|
29
|
+
BetaToolUseBlock,
|
|
30
|
+
BetaToolUseBlockParam,
|
|
31
|
+
BetaUsage,
|
|
32
|
+
MessageCreateParams,
|
|
33
|
+
MessageCreateParamsNonStreaming,
|
|
34
|
+
MessageCreateParamsStreaming,
|
|
35
|
+
Messages,
|
|
36
|
+
} from "./messages.js";
|
|
37
|
+
export {
|
|
38
|
+
BetaMessageBatch,
|
|
39
|
+
BetaMessageBatchCanceledResult,
|
|
40
|
+
BetaMessageBatchErroredResult,
|
|
41
|
+
BetaMessageBatchExpiredResult,
|
|
42
|
+
BetaMessageBatchIndividualResponse,
|
|
43
|
+
BetaMessageBatchRequestCounts,
|
|
44
|
+
BetaMessageBatchResult,
|
|
45
|
+
BetaMessageBatchSucceededResult,
|
|
46
|
+
BatchCreateParams,
|
|
47
|
+
BatchRetrieveParams,
|
|
48
|
+
BatchListParams,
|
|
49
|
+
BatchCancelParams,
|
|
50
|
+
BatchResultsParams,
|
|
51
|
+
BetaMessageBatchesPage,
|
|
52
|
+
Batches,
|
|
53
|
+
} from "./batches.js";
|