@anthropic-ai/sdk 0.66.0 → 0.67.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 +16 -0
- package/bin/cli +12 -5
- package/bin/migration-config.json +76 -1
- package/client.d.mts +5 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -1
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +42 -0
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +42 -0
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +63 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +60 -0
- package/core/pagination.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +7 -3
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +7 -3
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +2 -1
- package/resources/beta/index.d.mts.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 +3 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -0
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/messages/index.d.mts +1 -1
- package/resources/beta/messages/index.d.mts.map +1 -1
- package/resources/beta/messages/index.d.ts +1 -1
- package/resources/beta/messages/index.d.ts.map +1 -1
- package/resources/beta/messages/index.js.map +1 -1
- package/resources/beta/messages/index.mjs.map +1 -1
- package/resources/beta/messages/messages.d.mts +91 -44
- package/resources/beta/messages/messages.d.mts.map +1 -1
- package/resources/beta/messages/messages.d.ts +91 -44
- package/resources/beta/messages/messages.d.ts.map +1 -1
- package/resources/beta/messages/messages.js +3 -3
- package/resources/beta/messages/messages.js.map +1 -1
- package/resources/beta/messages/messages.mjs +3 -3
- package/resources/beta/messages/messages.mjs.map +1 -1
- package/resources/beta/skills/index.d.mts +3 -0
- package/resources/beta/skills/index.d.mts.map +1 -0
- package/resources/beta/skills/index.d.ts +3 -0
- package/resources/beta/skills/index.d.ts.map +1 -0
- package/resources/beta/skills/index.js +9 -0
- package/resources/beta/skills/index.js.map +1 -0
- package/resources/beta/skills/index.mjs +4 -0
- package/resources/beta/skills/index.mjs.map +1 -0
- package/resources/beta/skills/skills.d.mts +249 -0
- package/resources/beta/skills/skills.d.mts.map +1 -0
- package/resources/beta/skills/skills.d.ts +249 -0
- package/resources/beta/skills/skills.d.ts.map +1 -0
- package/resources/beta/skills/skills.js +98 -0
- package/resources/beta/skills/skills.js.map +1 -0
- package/resources/beta/skills/skills.mjs +93 -0
- package/resources/beta/skills/skills.mjs.map +1 -0
- package/resources/beta/skills/versions.d.mts +257 -0
- package/resources/beta/skills/versions.d.mts.map +1 -0
- package/resources/beta/skills/versions.d.ts +257 -0
- package/resources/beta/skills/versions.d.ts.map +1 -0
- package/resources/beta/skills/versions.js +100 -0
- package/resources/beta/skills/versions.js.map +1 -0
- package/resources/beta/skills/versions.mjs +96 -0
- package/resources/beta/skills/versions.mjs.map +1 -0
- package/resources/beta/skills.d.mts +2 -0
- package/resources/beta/skills.d.mts.map +1 -0
- package/resources/beta/skills.d.ts +2 -0
- package/resources/beta/skills.d.ts.map +1 -0
- package/resources/beta/skills.js +6 -0
- package/resources/beta/skills.js.map +1 -0
- package/resources/beta/skills.mjs +3 -0
- package/resources/beta/skills.mjs.map +1 -0
- package/resources/completions.d.mts +9 -10
- package/resources/completions.d.mts.map +1 -1
- package/resources/completions.d.ts +9 -10
- package/resources/completions.d.ts.map +1 -1
- package/resources/messages/messages.d.mts +28 -31
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +28 -31
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +3 -3
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +3 -3
- package/resources/messages/messages.mjs.map +1 -1
- package/src/client.ts +14 -1
- package/src/core/pagination.ts +130 -0
- package/src/resources/beta/beta.ts +36 -1
- package/src/resources/beta/index.ts +15 -0
- package/src/resources/beta/messages/index.ts +3 -0
- package/src/resources/beta/messages/messages.ts +104 -45
- package/src/resources/beta/skills/index.ts +26 -0
- package/src/resources/beta/skills/skills.ts +383 -0
- package/src/resources/beta/skills/versions.ts +374 -0
- package/src/resources/beta/skills.ts +3 -0
- package/src/resources/completions.ts +9 -10
- package/src/resources/messages/messages.ts +29 -42
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as BetaAPI from '../beta';
|
|
5
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { PageCursor, type PageCursorParams, PagePromise } from '../../../core/pagination';
|
|
7
|
+
import { type Uploadable } from '../../../core/uploads';
|
|
8
|
+
import { buildHeaders } from '../../../internal/headers';
|
|
9
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
10
|
+
import { multipartFormRequestOptions } from '../../../internal/uploads';
|
|
11
|
+
import { path } from '../../../internal/utils/path';
|
|
12
|
+
|
|
13
|
+
export class Versions extends APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Create Skill Version
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const version = await client.beta.skills.versions.create(
|
|
20
|
+
* 'skill_id',
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(
|
|
25
|
+
skillID: string,
|
|
26
|
+
params: VersionCreateParams | null | undefined = {},
|
|
27
|
+
options?: RequestOptions,
|
|
28
|
+
): APIPromise<VersionCreateResponse> {
|
|
29
|
+
const { betas, ...body } = params ?? {};
|
|
30
|
+
return this._client.post(
|
|
31
|
+
path`/v1/skills/${skillID}/versions?beta=true`,
|
|
32
|
+
multipartFormRequestOptions(
|
|
33
|
+
{
|
|
34
|
+
body,
|
|
35
|
+
...options,
|
|
36
|
+
headers: buildHeaders([
|
|
37
|
+
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
|
|
38
|
+
options?.headers,
|
|
39
|
+
]),
|
|
40
|
+
},
|
|
41
|
+
this._client,
|
|
42
|
+
),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Get Skill Version
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const version = await client.beta.skills.versions.retrieve(
|
|
52
|
+
* 'version',
|
|
53
|
+
* { skill_id: 'skill_id' },
|
|
54
|
+
* );
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
retrieve(
|
|
58
|
+
version: string,
|
|
59
|
+
params: VersionRetrieveParams,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): APIPromise<VersionRetrieveResponse> {
|
|
62
|
+
const { skill_id, betas } = params;
|
|
63
|
+
return this._client.get(path`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
|
|
64
|
+
...options,
|
|
65
|
+
headers: buildHeaders([
|
|
66
|
+
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
|
|
67
|
+
options?.headers,
|
|
68
|
+
]),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* List Skill Versions
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* // Automatically fetches more pages as needed.
|
|
78
|
+
* for await (const versionListResponse of client.beta.skills.versions.list(
|
|
79
|
+
* 'skill_id',
|
|
80
|
+
* )) {
|
|
81
|
+
* // ...
|
|
82
|
+
* }
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
list(
|
|
86
|
+
skillID: string,
|
|
87
|
+
params: VersionListParams | null | undefined = {},
|
|
88
|
+
options?: RequestOptions,
|
|
89
|
+
): PagePromise<VersionListResponsesPageCursor, VersionListResponse> {
|
|
90
|
+
const { betas, ...query } = params ?? {};
|
|
91
|
+
return this._client.getAPIList(
|
|
92
|
+
path`/v1/skills/${skillID}/versions?beta=true`,
|
|
93
|
+
PageCursor<VersionListResponse>,
|
|
94
|
+
{
|
|
95
|
+
query,
|
|
96
|
+
...options,
|
|
97
|
+
headers: buildHeaders([
|
|
98
|
+
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
|
|
99
|
+
options?.headers,
|
|
100
|
+
]),
|
|
101
|
+
},
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Delete Skill Version
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const version = await client.beta.skills.versions.delete(
|
|
111
|
+
* 'version',
|
|
112
|
+
* { skill_id: 'skill_id' },
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
delete(
|
|
117
|
+
version: string,
|
|
118
|
+
params: VersionDeleteParams,
|
|
119
|
+
options?: RequestOptions,
|
|
120
|
+
): APIPromise<VersionDeleteResponse> {
|
|
121
|
+
const { skill_id, betas } = params;
|
|
122
|
+
return this._client.delete(path`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
|
|
123
|
+
...options,
|
|
124
|
+
headers: buildHeaders([
|
|
125
|
+
{ 'anthropic-beta': [...(betas ?? []), 'skills-2025-10-02'].toString() },
|
|
126
|
+
options?.headers,
|
|
127
|
+
]),
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type VersionListResponsesPageCursor = PageCursor<VersionListResponse>;
|
|
133
|
+
|
|
134
|
+
export interface VersionCreateResponse {
|
|
135
|
+
/**
|
|
136
|
+
* Unique identifier for the skill version.
|
|
137
|
+
*
|
|
138
|
+
* The format and length of IDs may change over time.
|
|
139
|
+
*/
|
|
140
|
+
id: string;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* ISO 8601 timestamp of when the skill version was created.
|
|
144
|
+
*/
|
|
145
|
+
created_at: string;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Description of the skill version.
|
|
149
|
+
*
|
|
150
|
+
* This is extracted from the SKILL.md file in the skill upload.
|
|
151
|
+
*/
|
|
152
|
+
description: string;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Directory name of the skill version.
|
|
156
|
+
*
|
|
157
|
+
* This is the top-level directory name that was extracted from the uploaded files.
|
|
158
|
+
*/
|
|
159
|
+
directory: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Human-readable name of the skill version.
|
|
163
|
+
*
|
|
164
|
+
* This is extracted from the SKILL.md file in the skill upload.
|
|
165
|
+
*/
|
|
166
|
+
name: string;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Identifier for the skill that this version belongs to.
|
|
170
|
+
*/
|
|
171
|
+
skill_id: string;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Object type.
|
|
175
|
+
*
|
|
176
|
+
* For Skill Versions, this is always `"skill_version"`.
|
|
177
|
+
*/
|
|
178
|
+
type: string;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Version identifier for the skill.
|
|
182
|
+
*
|
|
183
|
+
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
|
|
184
|
+
*/
|
|
185
|
+
version: string;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface VersionRetrieveResponse {
|
|
189
|
+
/**
|
|
190
|
+
* Unique identifier for the skill version.
|
|
191
|
+
*
|
|
192
|
+
* The format and length of IDs may change over time.
|
|
193
|
+
*/
|
|
194
|
+
id: string;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* ISO 8601 timestamp of when the skill version was created.
|
|
198
|
+
*/
|
|
199
|
+
created_at: string;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Description of the skill version.
|
|
203
|
+
*
|
|
204
|
+
* This is extracted from the SKILL.md file in the skill upload.
|
|
205
|
+
*/
|
|
206
|
+
description: string;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Directory name of the skill version.
|
|
210
|
+
*
|
|
211
|
+
* This is the top-level directory name that was extracted from the uploaded files.
|
|
212
|
+
*/
|
|
213
|
+
directory: string;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Human-readable name of the skill version.
|
|
217
|
+
*
|
|
218
|
+
* This is extracted from the SKILL.md file in the skill upload.
|
|
219
|
+
*/
|
|
220
|
+
name: string;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Identifier for the skill that this version belongs to.
|
|
224
|
+
*/
|
|
225
|
+
skill_id: string;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Object type.
|
|
229
|
+
*
|
|
230
|
+
* For Skill Versions, this is always `"skill_version"`.
|
|
231
|
+
*/
|
|
232
|
+
type: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Version identifier for the skill.
|
|
236
|
+
*
|
|
237
|
+
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
|
|
238
|
+
*/
|
|
239
|
+
version: string;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export interface VersionListResponse {
|
|
243
|
+
/**
|
|
244
|
+
* Unique identifier for the skill version.
|
|
245
|
+
*
|
|
246
|
+
* The format and length of IDs may change over time.
|
|
247
|
+
*/
|
|
248
|
+
id: string;
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* ISO 8601 timestamp of when the skill version was created.
|
|
252
|
+
*/
|
|
253
|
+
created_at: string;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Description of the skill version.
|
|
257
|
+
*
|
|
258
|
+
* This is extracted from the SKILL.md file in the skill upload.
|
|
259
|
+
*/
|
|
260
|
+
description: string;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Directory name of the skill version.
|
|
264
|
+
*
|
|
265
|
+
* This is the top-level directory name that was extracted from the uploaded files.
|
|
266
|
+
*/
|
|
267
|
+
directory: string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Human-readable name of the skill version.
|
|
271
|
+
*
|
|
272
|
+
* This is extracted from the SKILL.md file in the skill upload.
|
|
273
|
+
*/
|
|
274
|
+
name: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Identifier for the skill that this version belongs to.
|
|
278
|
+
*/
|
|
279
|
+
skill_id: string;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Object type.
|
|
283
|
+
*
|
|
284
|
+
* For Skill Versions, this is always `"skill_version"`.
|
|
285
|
+
*/
|
|
286
|
+
type: string;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Version identifier for the skill.
|
|
290
|
+
*
|
|
291
|
+
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
|
|
292
|
+
*/
|
|
293
|
+
version: string;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export interface VersionDeleteResponse {
|
|
297
|
+
/**
|
|
298
|
+
* Version identifier for the skill.
|
|
299
|
+
*
|
|
300
|
+
* Each version is identified by a Unix epoch timestamp (e.g., "1759178010641129").
|
|
301
|
+
*/
|
|
302
|
+
id: string;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Deleted object type.
|
|
306
|
+
*
|
|
307
|
+
* For Skill Versions, this is always `"skill_version_deleted"`.
|
|
308
|
+
*/
|
|
309
|
+
type: string;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export interface VersionCreateParams {
|
|
313
|
+
/**
|
|
314
|
+
* Body param: Files to upload for the skill.
|
|
315
|
+
*
|
|
316
|
+
* All files must be in the same top-level directory and must include a SKILL.md
|
|
317
|
+
* file at the root of that directory.
|
|
318
|
+
*/
|
|
319
|
+
files?: Array<Uploadable> | null;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
323
|
+
*/
|
|
324
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export interface VersionRetrieveParams {
|
|
328
|
+
/**
|
|
329
|
+
* Path param: Unique identifier for the skill.
|
|
330
|
+
*
|
|
331
|
+
* The format and length of IDs may change over time.
|
|
332
|
+
*/
|
|
333
|
+
skill_id: string;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
337
|
+
*/
|
|
338
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export interface VersionListParams extends PageCursorParams {
|
|
342
|
+
/**
|
|
343
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
344
|
+
*/
|
|
345
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
export interface VersionDeleteParams {
|
|
349
|
+
/**
|
|
350
|
+
* Path param: Unique identifier for the skill.
|
|
351
|
+
*
|
|
352
|
+
* The format and length of IDs may change over time.
|
|
353
|
+
*/
|
|
354
|
+
skill_id: string;
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Header param: Optional header to specify the beta version(s) you want to use.
|
|
358
|
+
*/
|
|
359
|
+
betas?: Array<BetaAPI.AnthropicBeta>;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export declare namespace Versions {
|
|
363
|
+
export {
|
|
364
|
+
type VersionCreateResponse as VersionCreateResponse,
|
|
365
|
+
type VersionRetrieveResponse as VersionRetrieveResponse,
|
|
366
|
+
type VersionListResponse as VersionListResponse,
|
|
367
|
+
type VersionDeleteResponse as VersionDeleteResponse,
|
|
368
|
+
type VersionListResponsesPageCursor as VersionListResponsesPageCursor,
|
|
369
|
+
type VersionCreateParams as VersionCreateParams,
|
|
370
|
+
type VersionRetrieveParams as VersionRetrieveParams,
|
|
371
|
+
type VersionListParams as VersionListParams,
|
|
372
|
+
type VersionDeleteParams as VersionDeleteParams,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
@@ -14,17 +14,17 @@ export class Completions extends APIResource {
|
|
|
14
14
|
* [Legacy] Create a Text Completion.
|
|
15
15
|
*
|
|
16
16
|
* The Text Completions API is a legacy API. We recommend using the
|
|
17
|
-
* [Messages API](https://docs.
|
|
17
|
+
* [Messages API](https://docs.claude.com/en/api/messages) going forward.
|
|
18
18
|
*
|
|
19
19
|
* Future models and features will not be compatible with Text Completions. See our
|
|
20
|
-
* [migration guide](https://docs.
|
|
20
|
+
* [migration guide](https://docs.claude.com/en/api/migrating-from-text-completions-to-messages)
|
|
21
21
|
* for guidance in migrating from Text Completions to Messages.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
|
25
25
|
* const completion = await client.completions.create({
|
|
26
26
|
* max_tokens_to_sample: 256,
|
|
27
|
-
* model: 'claude-
|
|
27
|
+
* model: 'claude-sonnet-4-5',
|
|
28
28
|
* prompt: '\n\nHuman: Hello, world!\n\nAssistant:',
|
|
29
29
|
* });
|
|
30
30
|
* ```
|
|
@@ -120,10 +120,9 @@ export interface CompletionCreateParamsBase {
|
|
|
120
120
|
* "\n\nHuman: {userQuestion}\n\nAssistant:"
|
|
121
121
|
* ```
|
|
122
122
|
*
|
|
123
|
-
* See [prompt validation](https://docs.
|
|
124
|
-
* our guide to
|
|
125
|
-
*
|
|
126
|
-
* details.
|
|
123
|
+
* See [prompt validation](https://docs.claude.com/en/api/prompt-validation) and
|
|
124
|
+
* our guide to [prompt design](https://docs.claude.com/en/docs/intro-to-prompting)
|
|
125
|
+
* for more details.
|
|
127
126
|
*/
|
|
128
127
|
prompt: string;
|
|
129
128
|
|
|
@@ -145,7 +144,7 @@ export interface CompletionCreateParamsBase {
|
|
|
145
144
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
146
145
|
* events.
|
|
147
146
|
*
|
|
148
|
-
* See [streaming](https://docs.
|
|
147
|
+
* See [streaming](https://docs.claude.com/en/api/streaming) for details.
|
|
149
148
|
*/
|
|
150
149
|
stream?: boolean;
|
|
151
150
|
|
|
@@ -206,7 +205,7 @@ export interface CompletionCreateParamsNonStreaming extends CompletionCreatePara
|
|
|
206
205
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
207
206
|
* events.
|
|
208
207
|
*
|
|
209
|
-
* See [streaming](https://docs.
|
|
208
|
+
* See [streaming](https://docs.claude.com/en/api/streaming) for details.
|
|
210
209
|
*/
|
|
211
210
|
stream?: false;
|
|
212
211
|
}
|
|
@@ -216,7 +215,7 @@ export interface CompletionCreateParamsStreaming extends CompletionCreateParamsB
|
|
|
216
215
|
* Body param: Whether to incrementally stream the response using server-sent
|
|
217
216
|
* events.
|
|
218
217
|
*
|
|
219
|
-
* See [streaming](https://docs.
|
|
218
|
+
* See [streaming](https://docs.claude.com/en/api/streaming) for details.
|
|
220
219
|
*/
|
|
221
220
|
stream: true;
|
|
222
221
|
}
|
|
@@ -100,7 +100,7 @@ export class Messages extends APIResource {
|
|
|
100
100
|
* const messageTokensCount =
|
|
101
101
|
* await client.messages.countTokens({
|
|
102
102
|
* messages: [{ content: 'string', role: 'user' }],
|
|
103
|
-
* model: 'claude-
|
|
103
|
+
* model: 'claude-sonnet-4-5',
|
|
104
104
|
* });
|
|
105
105
|
* ```
|
|
106
106
|
*/
|
|
@@ -568,9 +568,6 @@ export type Model =
|
|
|
568
568
|
| 'claude-4-sonnet-20250514'
|
|
569
569
|
| 'claude-sonnet-4-5'
|
|
570
570
|
| 'claude-sonnet-4-5-20250929'
|
|
571
|
-
| 'claude-3-5-sonnet-latest'
|
|
572
|
-
| 'claude-3-5-sonnet-20241022'
|
|
573
|
-
| 'claude-3-5-sonnet-20240620'
|
|
574
571
|
| 'claude-opus-4-0'
|
|
575
572
|
| 'claude-opus-4-20250514'
|
|
576
573
|
| 'claude-4-opus-20250514'
|
|
@@ -592,8 +589,8 @@ const DEPRECATED_MODELS: {
|
|
|
592
589
|
'claude-3-opus-20240229': 'January 5th, 2026',
|
|
593
590
|
'claude-2.1': 'July 21st, 2025',
|
|
594
591
|
'claude-2.0': 'July 21st, 2025',
|
|
595
|
-
'claude-3-
|
|
596
|
-
'claude-3-
|
|
592
|
+
'claude-3-7-sonnet-latest': 'February 19th, 2026',
|
|
593
|
+
'claude-3-7-sonnet-20250219': 'February 19th, 2026',
|
|
597
594
|
};
|
|
598
595
|
|
|
599
596
|
export interface PlainTextSource {
|
|
@@ -757,14 +754,7 @@ export interface SignatureDelta {
|
|
|
757
754
|
type: 'signature_delta';
|
|
758
755
|
}
|
|
759
756
|
|
|
760
|
-
export type StopReason =
|
|
761
|
-
| 'end_turn'
|
|
762
|
-
| 'max_tokens'
|
|
763
|
-
| 'stop_sequence'
|
|
764
|
-
| 'tool_use'
|
|
765
|
-
| 'pause_turn'
|
|
766
|
-
| 'refusal'
|
|
767
|
-
| 'model_context_window_exceeded';
|
|
757
|
+
export type StopReason = 'end_turn' | 'max_tokens' | 'stop_sequence' | 'tool_use' | 'pause_turn' | 'refusal';
|
|
768
758
|
|
|
769
759
|
export interface TextBlock {
|
|
770
760
|
/**
|
|
@@ -843,7 +833,7 @@ export interface ThinkingConfigEnabled {
|
|
|
843
833
|
* Must be ≥1024 and less than `max_tokens`.
|
|
844
834
|
*
|
|
845
835
|
* See
|
|
846
|
-
* [extended thinking](https://docs.
|
|
836
|
+
* [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
847
837
|
* for details.
|
|
848
838
|
*/
|
|
849
839
|
budget_tokens: number;
|
|
@@ -859,7 +849,7 @@ export interface ThinkingConfigEnabled {
|
|
|
859
849
|
* tokens and counts towards your `max_tokens` limit.
|
|
860
850
|
*
|
|
861
851
|
* See
|
|
862
|
-
* [extended thinking](https://docs.
|
|
852
|
+
* [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
863
853
|
* for details.
|
|
864
854
|
*/
|
|
865
855
|
export type ThinkingConfigParam = ThinkingConfigEnabled | ThinkingConfigDisabled;
|
|
@@ -1320,7 +1310,7 @@ export interface MessageCreateParamsBase {
|
|
|
1320
1310
|
* only specifies the absolute maximum number of tokens to generate.
|
|
1321
1311
|
*
|
|
1322
1312
|
* Different models have different maximum values for this parameter. See
|
|
1323
|
-
* [models](https://docs.
|
|
1313
|
+
* [models](https://docs.claude.com/en/docs/models-overview) for details.
|
|
1324
1314
|
*/
|
|
1325
1315
|
max_tokens: number;
|
|
1326
1316
|
|
|
@@ -1382,12 +1372,12 @@ export interface MessageCreateParamsBase {
|
|
|
1382
1372
|
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
1383
1373
|
* ```
|
|
1384
1374
|
*
|
|
1385
|
-
* See [input examples](https://docs.
|
|
1375
|
+
* See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
1386
1376
|
*
|
|
1387
1377
|
* Note that if you want to include a
|
|
1388
|
-
* [system prompt](https://docs.
|
|
1389
|
-
*
|
|
1390
|
-
*
|
|
1378
|
+
* [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
1379
|
+
* top-level `system` parameter — there is no `"system"` role for input messages in
|
|
1380
|
+
* the Messages API.
|
|
1391
1381
|
*
|
|
1392
1382
|
* There is a limit of 100,000 messages in a single request.
|
|
1393
1383
|
*/
|
|
@@ -1410,7 +1400,7 @@ export interface MessageCreateParamsBase {
|
|
|
1410
1400
|
* for this request.
|
|
1411
1401
|
*
|
|
1412
1402
|
* Anthropic offers different levels of service for your API requests. See
|
|
1413
|
-
* [service-tiers](https://docs.
|
|
1403
|
+
* [service-tiers](https://docs.claude.com/en/api/service-tiers) for details.
|
|
1414
1404
|
*/
|
|
1415
1405
|
service_tier?: 'auto' | 'standard_only';
|
|
1416
1406
|
|
|
@@ -1430,8 +1420,7 @@ export interface MessageCreateParamsBase {
|
|
|
1430
1420
|
/**
|
|
1431
1421
|
* Whether to incrementally stream the response using server-sent events.
|
|
1432
1422
|
*
|
|
1433
|
-
* See [streaming](https://docs.
|
|
1434
|
-
* details.
|
|
1423
|
+
* See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
|
|
1435
1424
|
*/
|
|
1436
1425
|
stream?: boolean;
|
|
1437
1426
|
|
|
@@ -1440,7 +1429,7 @@ export interface MessageCreateParamsBase {
|
|
|
1440
1429
|
*
|
|
1441
1430
|
* A system prompt is a way of providing context and instructions to Claude, such
|
|
1442
1431
|
* as specifying a particular goal or role. See our
|
|
1443
|
-
* [guide to system prompts](https://docs.
|
|
1432
|
+
* [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
1444
1433
|
*/
|
|
1445
1434
|
system?: string | Array<TextBlockParam>;
|
|
1446
1435
|
|
|
@@ -1464,7 +1453,7 @@ export interface MessageCreateParamsBase {
|
|
|
1464
1453
|
* tokens and counts towards your `max_tokens` limit.
|
|
1465
1454
|
*
|
|
1466
1455
|
* See
|
|
1467
|
-
* [extended thinking](https://docs.
|
|
1456
|
+
* [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
1468
1457
|
* for details.
|
|
1469
1458
|
*/
|
|
1470
1459
|
thinking?: ThinkingConfigParam;
|
|
@@ -1485,9 +1474,9 @@ export interface MessageCreateParamsBase {
|
|
|
1485
1474
|
*
|
|
1486
1475
|
* There are two types of tools: **client tools** and **server tools**. The
|
|
1487
1476
|
* behavior described below applies to client tools. For
|
|
1488
|
-
* [server tools](https://docs.
|
|
1477
|
+
* [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
1489
1478
|
* see their individual documentation as each has its own behavior (e.g., the
|
|
1490
|
-
* [web search tool](https://docs.
|
|
1479
|
+
* [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
1491
1480
|
*
|
|
1492
1481
|
* Each tool definition includes:
|
|
1493
1482
|
*
|
|
@@ -1550,7 +1539,7 @@ export interface MessageCreateParamsBase {
|
|
|
1550
1539
|
* functions, or more generally whenever you want the model to produce a particular
|
|
1551
1540
|
* JSON structure of output.
|
|
1552
1541
|
*
|
|
1553
|
-
* See our [guide](https://docs.
|
|
1542
|
+
* See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
1554
1543
|
*/
|
|
1555
1544
|
tools?: Array<ToolUnion>;
|
|
1556
1545
|
|
|
@@ -1588,8 +1577,7 @@ export interface MessageCreateParamsNonStreaming extends MessageCreateParamsBase
|
|
|
1588
1577
|
/**
|
|
1589
1578
|
* Whether to incrementally stream the response using server-sent events.
|
|
1590
1579
|
*
|
|
1591
|
-
* See [streaming](https://docs.
|
|
1592
|
-
* details.
|
|
1580
|
+
* See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
|
|
1593
1581
|
*/
|
|
1594
1582
|
stream?: false;
|
|
1595
1583
|
}
|
|
@@ -1598,8 +1586,7 @@ export interface MessageCreateParamsStreaming extends MessageCreateParamsBase {
|
|
|
1598
1586
|
/**
|
|
1599
1587
|
* Whether to incrementally stream the response using server-sent events.
|
|
1600
1588
|
*
|
|
1601
|
-
* See [streaming](https://docs.
|
|
1602
|
-
* details.
|
|
1589
|
+
* See [streaming](https://docs.claude.com/en/api/messages-streaming) for details.
|
|
1603
1590
|
*/
|
|
1604
1591
|
stream: true;
|
|
1605
1592
|
}
|
|
@@ -1665,12 +1652,12 @@ export interface MessageCountTokensParams {
|
|
|
1665
1652
|
* { "role": "user", "content": [{ "type": "text", "text": "Hello, Claude" }] }
|
|
1666
1653
|
* ```
|
|
1667
1654
|
*
|
|
1668
|
-
* See [input examples](https://docs.
|
|
1655
|
+
* See [input examples](https://docs.claude.com/en/api/messages-examples).
|
|
1669
1656
|
*
|
|
1670
1657
|
* Note that if you want to include a
|
|
1671
|
-
* [system prompt](https://docs.
|
|
1672
|
-
*
|
|
1673
|
-
*
|
|
1658
|
+
* [system prompt](https://docs.claude.com/en/docs/system-prompts), you can use the
|
|
1659
|
+
* top-level `system` parameter — there is no `"system"` role for input messages in
|
|
1660
|
+
* the Messages API.
|
|
1674
1661
|
*
|
|
1675
1662
|
* There is a limit of 100,000 messages in a single request.
|
|
1676
1663
|
*/
|
|
@@ -1688,7 +1675,7 @@ export interface MessageCountTokensParams {
|
|
|
1688
1675
|
*
|
|
1689
1676
|
* A system prompt is a way of providing context and instructions to Claude, such
|
|
1690
1677
|
* as specifying a particular goal or role. See our
|
|
1691
|
-
* [guide to system prompts](https://docs.
|
|
1678
|
+
* [guide to system prompts](https://docs.claude.com/en/docs/system-prompts).
|
|
1692
1679
|
*/
|
|
1693
1680
|
system?: string | Array<TextBlockParam>;
|
|
1694
1681
|
|
|
@@ -1700,7 +1687,7 @@ export interface MessageCountTokensParams {
|
|
|
1700
1687
|
* tokens and counts towards your `max_tokens` limit.
|
|
1701
1688
|
*
|
|
1702
1689
|
* See
|
|
1703
|
-
* [extended thinking](https://docs.
|
|
1690
|
+
* [extended thinking](https://docs.claude.com/en/docs/build-with-claude/extended-thinking)
|
|
1704
1691
|
* for details.
|
|
1705
1692
|
*/
|
|
1706
1693
|
thinking?: ThinkingConfigParam;
|
|
@@ -1721,9 +1708,9 @@ export interface MessageCountTokensParams {
|
|
|
1721
1708
|
*
|
|
1722
1709
|
* There are two types of tools: **client tools** and **server tools**. The
|
|
1723
1710
|
* behavior described below applies to client tools. For
|
|
1724
|
-
* [server tools](https://docs.
|
|
1711
|
+
* [server tools](https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview#server-tools),
|
|
1725
1712
|
* see their individual documentation as each has its own behavior (e.g., the
|
|
1726
|
-
* [web search tool](https://docs.
|
|
1713
|
+
* [web search tool](https://docs.claude.com/en/docs/agents-and-tools/tool-use/web-search-tool)).
|
|
1727
1714
|
*
|
|
1728
1715
|
* Each tool definition includes:
|
|
1729
1716
|
*
|
|
@@ -1786,7 +1773,7 @@ export interface MessageCountTokensParams {
|
|
|
1786
1773
|
* functions, or more generally whenever you want the model to produce a particular
|
|
1787
1774
|
* JSON structure of output.
|
|
1788
1775
|
*
|
|
1789
|
-
* See our [guide](https://docs.
|
|
1776
|
+
* See our [guide](https://docs.claude.com/en/docs/tool-use) for more details.
|
|
1790
1777
|
*/
|
|
1791
1778
|
tools?: Array<MessageCountTokensTool>;
|
|
1792
1779
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.67.1'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.67.1";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.67.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.67.1'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|