@anthropic-ai/sdk 0.5.9 → 0.6.0
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 +46 -0
- package/README.md +56 -22
- package/_shims/ReadableStream.d.ts +38 -0
- package/_shims/ReadableStream.js +5 -0
- package/_shims/ReadableStream.mjs +7 -0
- package/_shims/ReadableStream.node.d.ts +6 -0
- package/_shims/ReadableStream.node.d.ts.map +1 -0
- package/_shims/ReadableStream.node.js +14 -0
- package/_shims/ReadableStream.node.js.map +1 -0
- package/_shims/ReadableStream.node.mjs +3 -0
- package/_shims/ReadableStream.node.mjs.map +1 -0
- package/_shims/fetch.d.ts +8 -1
- package/_shims/fetch.node.d.ts +11 -1
- package/core.d.ts +77 -28
- package/core.d.ts.map +1 -1
- package/core.js +181 -62
- package/core.js.map +1 -1
- package/core.mjs +175 -62
- package/core.mjs.map +1 -1
- package/index.d.mts +2 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/completions.d.ts +115 -191
- 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 +8 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/src/_shims/ReadableStream.d.ts +38 -0
- package/src/_shims/ReadableStream.js +5 -0
- package/src/_shims/ReadableStream.mjs +7 -0
- package/src/_shims/ReadableStream.node.ts +6 -0
- package/src/_shims/fetch.d.ts +8 -1
- package/src/_shims/fetch.deno.ts +23 -0
- package/src/_shims/fetch.node.d.ts +11 -1
- package/src/_shims/formdata.deno.ts +16 -0
- package/src/core.ts +247 -85
- package/src/index.ts +2 -0
- package/src/resources/completions.ts +121 -203
- package/src/resources/index.ts +8 -1
- package/src/streaming.ts +9 -15
- package/src/uploads.ts +7 -6
- package/src/version.ts +1 -1
- package/streaming.d.ts +3 -7
- package/streaming.d.ts.map +1 -1
- package/streaming.js +8 -5
- package/streaming.js.map +1 -1
- package/streaming.mjs +7 -4
- package/streaming.mjs.map +1 -1
- package/uploads.d.ts +5 -4
- package/uploads.d.ts.map +1 -1
- package/uploads.js +2 -2
- package/uploads.js.map +1 -1
- package/uploads.mjs +2 -2
- package/uploads.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.0](https://github.com/anthropics/anthropic-sdk-typescript/compare/v0.5.10...v0.6.0) (2023-08-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **client:** add support for accessing the raw response object ([#105](https://github.com/anthropics/anthropic-sdk-typescript/issues/105)) ([c86b059](https://github.com/anthropics/anthropic-sdk-typescript/commit/c86b0593a630f3adafc5c329019ea7028b6a41cd))
|
|
9
|
+
* **client:** detect browser usage ([#101](https://github.com/anthropics/anthropic-sdk-typescript/issues/101)) ([f4cae3f](https://github.com/anthropics/anthropic-sdk-typescript/commit/f4cae3f63c2e65e087a7bf27dac1eeb8200e0a36))
|
|
10
|
+
* **types:** improve streaming params types ([#102](https://github.com/anthropics/anthropic-sdk-typescript/issues/102)) ([cdf808c](https://github.com/anthropics/anthropic-sdk-typescript/commit/cdf808ca2a18cd744a5d1840e5e2adb3015e8d1d))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Documentation
|
|
14
|
+
|
|
15
|
+
* **readme:** minor updates ([#107](https://github.com/anthropics/anthropic-sdk-typescript/issues/107)) ([406fd97](https://github.com/anthropics/anthropic-sdk-typescript/commit/406fd97d4cee0dd363ad548c9a251f78091a70e3))
|
|
16
|
+
* **readme:** remove beta status + document versioning policy ([#100](https://github.com/anthropics/anthropic-sdk-typescript/issues/100)) ([e9ef3d2](https://github.com/anthropics/anthropic-sdk-typescript/commit/e9ef3d21a25e355d8bf94b7a941ad82ec5eafec8))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
|
|
21
|
+
* **docs:** remove trailing spaces ([#108](https://github.com/anthropics/anthropic-sdk-typescript/issues/108)) ([4ba2c6f](https://github.com/anthropics/anthropic-sdk-typescript/commit/4ba2c6f181521ed9a60ed45c35d2276129cd7a0b))
|
|
22
|
+
* **internal:** conditionally include bin during build output ([#109](https://github.com/anthropics/anthropic-sdk-typescript/issues/109)) ([58ac305](https://github.com/anthropics/anthropic-sdk-typescript/commit/58ac305d752d6b5c378f91b988ddfb97231c003c))
|
|
23
|
+
* **internal:** fix deno build ([#98](https://github.com/anthropics/anthropic-sdk-typescript/issues/98)) ([f011e04](https://github.com/anthropics/anthropic-sdk-typescript/commit/f011e041f2f9cabb12951013825c0f0a2a569053))
|
|
24
|
+
* **internal:** remove deno build ([#103](https://github.com/anthropics/anthropic-sdk-typescript/issues/103)) ([9af1527](https://github.com/anthropics/anthropic-sdk-typescript/commit/9af152707a9bcf3027afc64f027566be25da2eb9))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Refactors
|
|
28
|
+
|
|
29
|
+
* **client:** remove Stream.toReadableStream() ([#110](https://github.com/anthropics/anthropic-sdk-typescript/issues/110)) ([c370412](https://github.com/anthropics/anthropic-sdk-typescript/commit/c37041285ed9cccf6d980a953e14ffd4006a8acc))
|
|
30
|
+
|
|
31
|
+
## [0.5.10](https://github.com/anthropics/anthropic-sdk-typescript/compare/v0.5.9...v0.5.10) (2023-08-01)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Refactors
|
|
35
|
+
|
|
36
|
+
* create build for deno.land ([#93](https://github.com/anthropics/anthropic-sdk-typescript/issues/93)) ([2ea741a](https://github.com/anthropics/anthropic-sdk-typescript/commit/2ea741a4d4a3123b2eaafb87b73d7884c69ae23b))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Documentation
|
|
40
|
+
|
|
41
|
+
* **readme:** add token counting reference ([#94](https://github.com/anthropics/anthropic-sdk-typescript/issues/94)) ([2c6a699](https://github.com/anthropics/anthropic-sdk-typescript/commit/2c6a699d499a3468fc4312a6b6c9493ffd1806a2))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Chores
|
|
45
|
+
|
|
46
|
+
* **internal:** allow the build script to be run without yarn installed ([#91](https://github.com/anthropics/anthropic-sdk-typescript/issues/91)) ([9bd2b28](https://github.com/anthropics/anthropic-sdk-typescript/commit/9bd2b2871ca8a3b5f2466a904153d5c234094372))
|
|
47
|
+
* **internal:** fix deno build ([#96](https://github.com/anthropics/anthropic-sdk-typescript/issues/96)) ([3fdab4e](https://github.com/anthropics/anthropic-sdk-typescript/commit/3fdab4e33b4c8668d17b8cddabbb09a22adf4124))
|
|
48
|
+
|
|
3
49
|
## [0.5.9](https://github.com/anthropics/anthropic-sdk-typescript/compare/v0.5.8...v0.5.9) (2023-07-29)
|
|
4
50
|
|
|
5
51
|
|
package/README.md
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.org/package/@anthropic-ai/sdk)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
It includes TypeScript definitions for all request params and response fields.
|
|
5
|
+
This library provides convenient access to the Anthropic TypeScript REST API from server-side TypeScript or JavaScript.
|
|
7
6
|
|
|
8
7
|
## Migration from v0.4.x and below
|
|
9
8
|
|
|
@@ -79,8 +78,6 @@ Key interface changes:
|
|
|
79
78
|
|
|
80
79
|
</details>
|
|
81
80
|
|
|
82
|
-
## Documentation
|
|
83
|
-
|
|
84
81
|
The API documentation can be found [here](https://docs.anthropic.com/claude/reference/).
|
|
85
82
|
|
|
86
83
|
## Installation
|
|
@@ -104,7 +101,7 @@ async function main() {
|
|
|
104
101
|
const completion = await anthropic.completions.create({
|
|
105
102
|
model: 'claude-2',
|
|
106
103
|
max_tokens_to_sample: 300,
|
|
107
|
-
prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court
|
|
104
|
+
prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
107
|
|
|
@@ -121,7 +118,7 @@ import Anthropic from '@anthropic-ai/sdk';
|
|
|
121
118
|
const anthropic = new Anthropic();
|
|
122
119
|
|
|
123
120
|
const stream = await anthropic.completions.create({
|
|
124
|
-
prompt: `${Anthropic.HUMAN_PROMPT} Your prompt here
|
|
121
|
+
prompt: `${Anthropic.HUMAN_PROMPT} Your prompt here${Anthropic.AI_PROMPT}`,
|
|
125
122
|
model: 'claude-2',
|
|
126
123
|
stream: true,
|
|
127
124
|
max_tokens_to_sample: 300,
|
|
@@ -134,10 +131,9 @@ for await (const completion of stream) {
|
|
|
134
131
|
If you need to cancel a stream, you can `break` from the loop
|
|
135
132
|
or call `stream.controller.abort()`.
|
|
136
133
|
|
|
137
|
-
###
|
|
134
|
+
### Request & Response types
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
If you like, you may reference our types directly:
|
|
136
|
+
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
|
|
141
137
|
|
|
142
138
|
```ts
|
|
143
139
|
import Anthropic from '@anthropic-ai/sdk';
|
|
@@ -148,7 +144,7 @@ const anthropic = new Anthropic({
|
|
|
148
144
|
|
|
149
145
|
async function main() {
|
|
150
146
|
const params: Anthropic.CompletionCreateParams = {
|
|
151
|
-
prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court
|
|
147
|
+
prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,
|
|
152
148
|
max_tokens_to_sample: 300,
|
|
153
149
|
model: 'claude-2',
|
|
154
150
|
};
|
|
@@ -160,6 +156,12 @@ main();
|
|
|
160
156
|
|
|
161
157
|
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
162
158
|
|
|
159
|
+
## Counting Tokens
|
|
160
|
+
|
|
161
|
+
We provide a [separate package](https://github.com/anthropics/anthropic-tokenizer-typescript) for counting how many tokens a given piece of text contains.
|
|
162
|
+
|
|
163
|
+
See the [repository documentation](https://github.com/anthropics/anthropic-tokenizer-typescript) for more details.
|
|
164
|
+
|
|
163
165
|
## Handling errors
|
|
164
166
|
|
|
165
167
|
When the library is unable to connect to the API,
|
|
@@ -170,7 +172,7 @@ a subclass of `APIError` will be thrown:
|
|
|
170
172
|
async function main() {
|
|
171
173
|
const completion = await anthropic.completions
|
|
172
174
|
.create({
|
|
173
|
-
prompt: `${Anthropic.HUMAN_PROMPT} Your prompt here
|
|
175
|
+
prompt: `${Anthropic.HUMAN_PROMPT} Your prompt here${Anthropic.AI_PROMPT}`,
|
|
174
176
|
max_tokens_to_sample: 300,
|
|
175
177
|
model: 'claude-2',
|
|
176
178
|
})
|
|
@@ -219,7 +221,7 @@ const anthropic = new Anthropic({
|
|
|
219
221
|
// Or, configure per-request:
|
|
220
222
|
await anthropic.completions.create(
|
|
221
223
|
{
|
|
222
|
-
prompt: `${Anthropic.HUMAN_PROMPT} Can you help me effectively ask for a raise at work
|
|
224
|
+
prompt: `${Anthropic.HUMAN_PROMPT} Can you help me effectively ask for a raise at work?${Anthropic.AI_PROMPT}`,
|
|
223
225
|
max_tokens_to_sample: 300,
|
|
224
226
|
model: 'claude-2',
|
|
225
227
|
},
|
|
@@ -231,19 +233,19 @@ await anthropic.completions.create(
|
|
|
231
233
|
|
|
232
234
|
### Timeouts
|
|
233
235
|
|
|
234
|
-
Requests time out after
|
|
236
|
+
Requests time out after 10 minutes by default. You can configure this with a `timeout` option:
|
|
235
237
|
|
|
236
238
|
<!-- prettier-ignore -->
|
|
237
239
|
```ts
|
|
238
240
|
// Configure the default for all requests:
|
|
239
241
|
const anthropic = new Anthropic({
|
|
240
|
-
timeout: 20 * 1000, // 20 seconds (default is
|
|
242
|
+
timeout: 20 * 1000, // 20 seconds (default is 10 minutes)
|
|
241
243
|
});
|
|
242
244
|
|
|
243
245
|
// Override per-request:
|
|
244
246
|
await anthropic.completions.create(
|
|
245
247
|
{
|
|
246
|
-
prompt: `${Anthropic.HUMAN_PROMPT} Where can I get a good coffee in my neighbourhood
|
|
248
|
+
prompt: `${Anthropic.HUMAN_PROMPT} Where can I get a good coffee in my neighbourhood?${Anthropic.AI_PROMPT}`,
|
|
247
249
|
max_tokens_to_sample: 300,
|
|
248
250
|
model: 'claude-2',
|
|
249
251
|
},
|
|
@@ -257,6 +259,32 @@ On timeout, an `APIConnectionTimeoutError` is thrown.
|
|
|
257
259
|
|
|
258
260
|
Note that requests which time out will be [retried twice by default](#retries).
|
|
259
261
|
|
|
262
|
+
## Advanced Usage
|
|
263
|
+
|
|
264
|
+
### Accessing raw Response data (e.g., headers)
|
|
265
|
+
|
|
266
|
+
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
267
|
+
|
|
268
|
+
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
|
|
269
|
+
|
|
270
|
+
```ts
|
|
271
|
+
const anthropic = new Anthropic();
|
|
272
|
+
|
|
273
|
+
const response = await anthropic.completions
|
|
274
|
+
.create({
|
|
275
|
+
prompt: `${Anthropic.HUMAN_PROMPT} Can you help me effectively ask for a raise at work?${Anthropic.AI_PROMPT}`,
|
|
276
|
+
max_tokens_to_sample: 300,
|
|
277
|
+
model: 'claude-2',
|
|
278
|
+
})
|
|
279
|
+
.asResponse();
|
|
280
|
+
console.log(response.headers.get('X-My-Header'));
|
|
281
|
+
console.log(response.raw.statusText); // access the underlying Response object
|
|
282
|
+
|
|
283
|
+
// parses the response body, returning an object if the API responds with JSON
|
|
284
|
+
const completion: Completions.Completion = await response.parse();
|
|
285
|
+
console.log(completion.completion);
|
|
286
|
+
```
|
|
287
|
+
|
|
260
288
|
## Configuring an HTTP(S) Agent (e.g., for proxies)
|
|
261
289
|
|
|
262
290
|
By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests.
|
|
@@ -277,7 +305,7 @@ const anthropic = new Anthropic({
|
|
|
277
305
|
// Override per-request:
|
|
278
306
|
await anthropic.completions.create(
|
|
279
307
|
{
|
|
280
|
-
prompt: `${Anthropic.HUMAN_PROMPT} How does a court case get to the Supreme Court
|
|
308
|
+
prompt: `${Anthropic.HUMAN_PROMPT} How does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,
|
|
281
309
|
max_tokens_to_sample: 300,
|
|
282
310
|
model: 'claude-2',
|
|
283
311
|
},
|
|
@@ -288,11 +316,15 @@ await anthropic.completions.create(
|
|
|
288
316
|
);
|
|
289
317
|
```
|
|
290
318
|
|
|
291
|
-
##
|
|
319
|
+
## Semantic Versioning
|
|
320
|
+
|
|
321
|
+
This package generally attempts to follow [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
322
|
+
|
|
323
|
+
1. Changes that only affect static types, without breaking runtime behavior.
|
|
324
|
+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
|
|
325
|
+
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
292
326
|
|
|
293
|
-
|
|
294
|
-
and subject to change without a major semver bump;
|
|
295
|
-
please reach out if you rely on any undocumented behavior.
|
|
327
|
+
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
296
328
|
|
|
297
329
|
We are keen for your feedback; please open an [issue](https://www.github.com/anthropics/anthropic-sdk-typescript/issues) with questions, bugs, or suggestions.
|
|
298
330
|
|
|
@@ -301,7 +333,9 @@ We are keen for your feedback; please open an [issue](https://www.github.com/ant
|
|
|
301
333
|
The following runtimes are supported:
|
|
302
334
|
|
|
303
335
|
- Node.js 16 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
304
|
-
- Deno v1.28.0 or higher
|
|
305
|
-
|
|
336
|
+
- Deno v1.28.0 or higher, using `import Anthropic from "npm:@anthropic-ai/sdk"`.
|
|
337
|
+
Deno Deploy is not yet supported.
|
|
338
|
+
- Cloudflare Workers.
|
|
339
|
+
- Vercel Edge Runtime.
|
|
306
340
|
|
|
307
341
|
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* >>> Confused? <<<
|
|
7
|
+
*
|
|
8
|
+
* If you're getting errors from these types, try adding "lib": ["DOM"]
|
|
9
|
+
* to your tsconfig.json, or otherwise configure the appropriate builtin
|
|
10
|
+
* `ReadableStream` type for your environment.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// @ts-ignore
|
|
14
|
+
type _ReadableStream<R = any> = unknown extends ReadableStream ? never : ReadableStream<R>;
|
|
15
|
+
declare const _ReadableStream: {
|
|
16
|
+
prototype: _ReadableStream;
|
|
17
|
+
new (
|
|
18
|
+
underlyingSource: _UnderlyingByteSource,
|
|
19
|
+
strategy?: { highWaterMark?: number },
|
|
20
|
+
): _ReadableStream<Uint8Array>;
|
|
21
|
+
new <R = any>(
|
|
22
|
+
underlyingSource: _UnderlyingDefaultSource<R>,
|
|
23
|
+
strategy?: _QueuingStrategy<R>,
|
|
24
|
+
): _ReadableStream<R>;
|
|
25
|
+
new <R = any>(underlyingSource?: _UnderlyingSource<R>, strategy?: _QueuingStrategy<R>): _ReadableStream<R>;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
type _UnderlyingSource<R = any> = unknown extends UnderlyingSource ? never : UnderlyingSource<R>;
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
type _UnderlyingByteSource = unknown extends UnderlyingByteSource ? never : UnderlyingByteSource;
|
|
32
|
+
type _UnderlyingDefaultSource<R = any> =
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
unknown extends UnderlyingDefaultSource ? never : UnderlyingDefaultSource<R>;
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
type _QueuingStrategy<R = any> = unknown extends QueuingStrategy ? never : QueuingStrategy<R>;
|
|
37
|
+
|
|
38
|
+
export { _ReadableStream as ReadableStream };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadableStream.node.d.ts","sourceRoot":"","sources":["../src/_shims/ReadableStream.node.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
3
|
+
exports.ReadableStream = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Disclaimer: modules in _shims aren't intended to be imported by SDK users.
|
|
6
|
+
*/
|
|
7
|
+
const web_streams_polyfill_1 = require('web-streams-polyfill');
|
|
8
|
+
Object.defineProperty(exports, 'ReadableStream', {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () {
|
|
11
|
+
return web_streams_polyfill_1.ReadableStream;
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=ReadableStream.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadableStream.node.js","sourceRoot":"","sources":["../src/_shims/ReadableStream.node.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+DAAsD;AAE7C,+FAFA,qCAAc,OAEA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadableStream.node.mjs","sourceRoot":"","sources":["../src/_shims/ReadableStream.node.ts"],"names":[],"mappings":"OAGO,EAAE,cAAc,EAAE,MAAM,sBAAsB;AAErD,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/_shims/fetch.d.ts
CHANGED
|
@@ -26,6 +26,8 @@ type _Response = unknown extends Response ? never : Response;
|
|
|
26
26
|
// @ts-ignore
|
|
27
27
|
type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
|
|
28
28
|
// @ts-ignore
|
|
29
|
+
type _ResponseType = unknown extends ResponseType ? never : ResponseType;
|
|
30
|
+
// @ts-ignore
|
|
29
31
|
type _BodyInit = unknown extends BodyInit ? never : BodyInit;
|
|
30
32
|
// @ts-ignore
|
|
31
33
|
type _Headers = unknown extends Headers ? never : Headers;
|
|
@@ -49,4 +51,9 @@ declare const _Headers: {
|
|
|
49
51
|
export const isPolyfilled = false;
|
|
50
52
|
|
|
51
53
|
export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
|
|
52
|
-
export type {
|
|
54
|
+
export type {
|
|
55
|
+
_RequestInit as RequestInit,
|
|
56
|
+
_RequestInfo as RequestInfo,
|
|
57
|
+
_ResponseType as ResponseType,
|
|
58
|
+
_BodyInit as BodyInit,
|
|
59
|
+
};
|
package/_shims/fetch.node.d.ts
CHANGED
|
@@ -26,6 +26,11 @@ type _RequestInit = unknown extends RequestInit ? nf.RequestInit : RequestInit;
|
|
|
26
26
|
type _Response = unknown extends Response ? nf.Response : Response;
|
|
27
27
|
// @ts-ignore
|
|
28
28
|
type _ResponseInit = unknown extends ResponseInit ? nf.ResponseInit : ResponseInit;
|
|
29
|
+
type _ResponseType =
|
|
30
|
+
// @ts-ignore
|
|
31
|
+
unknown extends ResponseType ? 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'
|
|
32
|
+
: // @ts-ignore
|
|
33
|
+
ResponseType;
|
|
29
34
|
// @ts-ignore
|
|
30
35
|
type _BodyInit = unknown extends BodyInit ? nf.BodyInit : BodyInit;
|
|
31
36
|
// @ts-ignore
|
|
@@ -50,4 +55,9 @@ declare const _Headers: {
|
|
|
50
55
|
export const isPolyfilled = false;
|
|
51
56
|
|
|
52
57
|
export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
|
|
53
|
-
export type {
|
|
58
|
+
export type {
|
|
59
|
+
_RequestInit as RequestInit,
|
|
60
|
+
_RequestInfo as RequestInfo,
|
|
61
|
+
_ResponseType as ResponseType,
|
|
62
|
+
_BodyInit as BodyInit,
|
|
63
|
+
};
|
package/core.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { APIError } from './error.js';
|
|
|
2
2
|
import type { Readable } from '@anthropic-ai/sdk/_shims/node-readable';
|
|
3
3
|
import { type Agent } from '@anthropic-ai/sdk/_shims/agent';
|
|
4
4
|
import { type RequestInfo, type RequestInit, type Response } from '@anthropic-ai/sdk/_shims/fetch';
|
|
5
|
+
export { type Response };
|
|
5
6
|
export {
|
|
6
7
|
maybeMultipartFormRequestOptions,
|
|
7
8
|
multipartFormRequestOptions,
|
|
@@ -9,6 +10,53 @@ export {
|
|
|
9
10
|
type Uploadable,
|
|
10
11
|
} from './uploads.js';
|
|
11
12
|
export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
13
|
+
type PromiseOrValue<T> = T | Promise<T>;
|
|
14
|
+
type APIResponseProps = {
|
|
15
|
+
response: Response;
|
|
16
|
+
options: FinalRequestOptions;
|
|
17
|
+
controller: AbortController;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A subclass of `Promise` providing additional helper methods
|
|
21
|
+
* for interacting with the SDK.
|
|
22
|
+
*/
|
|
23
|
+
export declare class APIPromise<T> extends Promise<T> {
|
|
24
|
+
private responsePromise;
|
|
25
|
+
private parseResponse;
|
|
26
|
+
private parsedPromise;
|
|
27
|
+
constructor(
|
|
28
|
+
responsePromise: Promise<APIResponseProps>,
|
|
29
|
+
parseResponse?: (props: APIResponseProps) => PromiseOrValue<T>,
|
|
30
|
+
);
|
|
31
|
+
_thenUnwrap<U>(transform: (data: T) => U): APIPromise<U>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the raw `Response` instance instead of parsing the response
|
|
34
|
+
* data.
|
|
35
|
+
*
|
|
36
|
+
* If you want to parse the response body but still get the `Response`
|
|
37
|
+
* instance, you can use {@link withResponse()}.
|
|
38
|
+
*/
|
|
39
|
+
asResponse(): Promise<Response>;
|
|
40
|
+
/**
|
|
41
|
+
* Gets the parsed response data and the raw `Response` instance.
|
|
42
|
+
*
|
|
43
|
+
* If you just want to get the raw `Response` instance without parsing it,
|
|
44
|
+
* you can use {@link asResponse()}.
|
|
45
|
+
*/
|
|
46
|
+
withResponse(): Promise<{
|
|
47
|
+
data: T;
|
|
48
|
+
response: Response;
|
|
49
|
+
}>;
|
|
50
|
+
private parse;
|
|
51
|
+
then<TResult1 = T, TResult2 = never>(
|
|
52
|
+
onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null,
|
|
53
|
+
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null,
|
|
54
|
+
): Promise<TResult1 | TResult2>;
|
|
55
|
+
catch<TResult = never>(
|
|
56
|
+
onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null,
|
|
57
|
+
): Promise<T | TResult>;
|
|
58
|
+
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
59
|
+
}
|
|
12
60
|
export declare abstract class APIClient {
|
|
13
61
|
baseURL: string;
|
|
14
62
|
maxRetries: number;
|
|
@@ -45,16 +93,17 @@ export declare abstract class APIClient {
|
|
|
45
93
|
*/
|
|
46
94
|
protected validateHeaders(headers: Headers, customHeaders: Headers): void;
|
|
47
95
|
protected defaultIdempotencyKey(): string;
|
|
48
|
-
get<Req extends {}, Rsp>(path: string, opts?: RequestOptions<Req
|
|
49
|
-
post<Req extends {}, Rsp>(path: string, opts?: RequestOptions<Req
|
|
50
|
-
patch<Req extends {}, Rsp>(path: string, opts?: RequestOptions<Req
|
|
51
|
-
put<Req extends {}, Rsp>(path: string, opts?: RequestOptions<Req
|
|
52
|
-
delete<Req extends {}, Rsp>(path: string, opts?: RequestOptions<Req
|
|
96
|
+
get<Req extends {}, Rsp>(path: string, opts?: PromiseOrValue<RequestOptions<Req>>): APIPromise<Rsp>;
|
|
97
|
+
post<Req extends {}, Rsp>(path: string, opts?: PromiseOrValue<RequestOptions<Req>>): APIPromise<Rsp>;
|
|
98
|
+
patch<Req extends {}, Rsp>(path: string, opts?: PromiseOrValue<RequestOptions<Req>>): APIPromise<Rsp>;
|
|
99
|
+
put<Req extends {}, Rsp>(path: string, opts?: PromiseOrValue<RequestOptions<Req>>): APIPromise<Rsp>;
|
|
100
|
+
delete<Req extends {}, Rsp>(path: string, opts?: PromiseOrValue<RequestOptions<Req>>): APIPromise<Rsp>;
|
|
101
|
+
private methodRequest;
|
|
53
102
|
getAPIList<Item, PageClass extends AbstractPage<Item> = AbstractPage<Item>>(
|
|
54
103
|
path: string,
|
|
55
104
|
Page: new (...args: any[]) => PageClass,
|
|
56
105
|
opts?: RequestOptions<any>,
|
|
57
|
-
): PagePromise<PageClass>;
|
|
106
|
+
): PagePromise<PageClass, Item>;
|
|
58
107
|
private calculateContentLength;
|
|
59
108
|
buildRequest<Req extends {}>(
|
|
60
109
|
options: FinalRequestOptions<Req>,
|
|
@@ -84,13 +133,14 @@ export declare abstract class APIClient {
|
|
|
84
133
|
headers: Headers | undefined,
|
|
85
134
|
): APIError;
|
|
86
135
|
request<Req extends {}, Rsp>(
|
|
87
|
-
options: FinalRequestOptions<Req
|
|
88
|
-
|
|
89
|
-
):
|
|
136
|
+
options: PromiseOrValue<FinalRequestOptions<Req>>,
|
|
137
|
+
remainingRetries?: number | null,
|
|
138
|
+
): APIPromise<Rsp>;
|
|
139
|
+
private makeRequest;
|
|
90
140
|
requestAPIList<Item = unknown, PageClass extends AbstractPage<Item> = AbstractPage<Item>>(
|
|
91
141
|
Page: new (...args: ConstructorParameters<typeof AbstractPage>) => PageClass,
|
|
92
142
|
options: FinalRequestOptions,
|
|
93
|
-
): PagePromise<PageClass>;
|
|
143
|
+
): PagePromise<PageClass, Item>;
|
|
94
144
|
buildURL<Req>(path: string, query: Req | undefined): string;
|
|
95
145
|
protected stringifyQuery(query: Record<string, unknown>): string;
|
|
96
146
|
fetchWithTimeout(
|
|
@@ -104,7 +154,6 @@ export declare abstract class APIClient {
|
|
|
104
154
|
private retryRequest;
|
|
105
155
|
private calculateRetryTimeoutSeconds;
|
|
106
156
|
private getUserAgent;
|
|
107
|
-
private debug;
|
|
108
157
|
}
|
|
109
158
|
export declare class APIResource {
|
|
110
159
|
protected client: APIClient;
|
|
@@ -126,7 +175,9 @@ export type PageInfo =
|
|
|
126
175
|
export declare abstract class AbstractPage<Item> implements AsyncIterable<Item> {
|
|
127
176
|
#private;
|
|
128
177
|
protected options: FinalRequestOptions;
|
|
129
|
-
|
|
178
|
+
protected response: Response;
|
|
179
|
+
protected body: unknown;
|
|
180
|
+
constructor(client: APIClient, response: Response, body: unknown, options: FinalRequestOptions);
|
|
130
181
|
/**
|
|
131
182
|
* @deprecated Use nextPageInfo instead
|
|
132
183
|
*/
|
|
@@ -138,27 +189,27 @@ export declare abstract class AbstractPage<Item> implements AsyncIterable<Item>
|
|
|
138
189
|
iterPages(): AsyncGenerator<AbstractPage<Item>, void, unknown>;
|
|
139
190
|
[Symbol.asyncIterator](): AsyncGenerator<Awaited<Item>, void, unknown>;
|
|
140
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* This subclass of Promise will resolve to an instantiated Page once the request completes.
|
|
194
|
+
*
|
|
195
|
+
* It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:
|
|
196
|
+
*
|
|
197
|
+
* for await (const item of client.items.list()) {
|
|
198
|
+
* console.log(item)
|
|
199
|
+
* }
|
|
200
|
+
*/
|
|
141
201
|
export declare class PagePromise<
|
|
142
202
|
PageClass extends AbstractPage<Item>,
|
|
143
203
|
Item = ReturnType<PageClass['getPaginatedItems']>[number],
|
|
144
204
|
>
|
|
145
|
-
extends
|
|
205
|
+
extends APIPromise<PageClass>
|
|
146
206
|
implements AsyncIterable<Item>
|
|
147
207
|
{
|
|
148
|
-
/**
|
|
149
|
-
* This subclass of Promise will resolve to an instantiated Page once the request completes.
|
|
150
|
-
*/
|
|
151
208
|
constructor(
|
|
152
209
|
client: APIClient,
|
|
153
|
-
|
|
154
|
-
options: FinalRequestOptions,
|
|
210
|
+
request: Promise<APIResponseProps>,
|
|
155
211
|
Page: new (...args: ConstructorParameters<typeof AbstractPage>) => PageClass,
|
|
156
212
|
);
|
|
157
|
-
/**
|
|
158
|
-
* Enable subclassing Promise.
|
|
159
|
-
* Ref: https://stackoverflow.com/a/60328122
|
|
160
|
-
*/
|
|
161
|
-
static get [Symbol.species](): PromiseConstructor;
|
|
162
213
|
/**
|
|
163
214
|
* Allow auto-paginating iteration on an unawaited list call, eg:
|
|
164
215
|
*
|
|
@@ -200,17 +251,13 @@ export type FinalRequestOptions<Req extends {} = Record<string, unknown> | Reada
|
|
|
200
251
|
method: HTTPMethod;
|
|
201
252
|
path: string;
|
|
202
253
|
};
|
|
203
|
-
export type APIResponse<T> = T & {
|
|
204
|
-
/** @deprecated - we plan to add a different way to access raw response information shortly. */
|
|
205
|
-
responseHeaders: Headers;
|
|
206
|
-
};
|
|
207
254
|
export declare const safeJSON: (text: string) => any;
|
|
208
255
|
export declare const castToError: (err: any) => Error;
|
|
209
256
|
export declare const ensurePresent: <T>(value: T | null | undefined) => T;
|
|
210
257
|
/**
|
|
211
258
|
* Read an environment variable.
|
|
212
259
|
*
|
|
213
|
-
* Will return
|
|
260
|
+
* Will return undefined if the environment variable doesn't exist or cannot be accessed.
|
|
214
261
|
*/
|
|
215
262
|
export declare const readEnv: (env: string) => string | undefined;
|
|
216
263
|
export declare const coerceInteger: (value: unknown) => number;
|
|
@@ -221,6 +268,8 @@ export declare const maybeCoerceFloat: (value: unknown) => number | undefined;
|
|
|
221
268
|
export declare const maybeCoerceBoolean: (value: unknown) => boolean | undefined;
|
|
222
269
|
export declare function isEmptyObj(obj: Object | null | undefined): boolean;
|
|
223
270
|
export declare function hasOwn(obj: Object, key: string): boolean;
|
|
271
|
+
export declare function debug(action: string, ...args: any[]): void;
|
|
272
|
+
export declare const isRunningInBrowser: () => boolean;
|
|
224
273
|
export interface HeadersProtocol {
|
|
225
274
|
get: (header: string) => string | null | undefined;
|
|
226
275
|
}
|
package/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["src/core.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EAAE,QAAQ,EAAoE,MAAM,SAAS,CAAC;AACrG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["src/core.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EAAE,QAAQ,EAAoE,MAAM,SAAS,CAAC;AACrG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACd,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;AAEzB,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,UAAU,EACV,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AAInB,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEhF,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CA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