@anthropic-ai/sdk 0.6.1 → 0.6.7
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 +127 -0
- package/README.md +16 -6
- package/_shims/MultipartBody.d.ts +9 -0
- package/_shims/MultipartBody.d.ts.map +1 -0
- package/_shims/MultipartBody.js +16 -0
- package/_shims/MultipartBody.js.map +1 -0
- package/_shims/MultipartBody.mjs +12 -0
- package/_shims/MultipartBody.mjs.map +1 -0
- package/_shims/README.md +46 -0
- package/{src/_shims/ReadableStream.node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
- package/_shims/auto/runtime-bun.d.ts.map +1 -0
- package/_shims/auto/runtime-bun.js +21 -0
- package/_shims/auto/runtime-bun.js.map +1 -0
- package/_shims/auto/runtime-bun.mjs +2 -0
- package/_shims/auto/runtime-bun.mjs.map +1 -0
- package/_shims/auto/runtime-node.d.ts +5 -0
- package/_shims/auto/runtime-node.d.ts.map +1 -0
- package/_shims/auto/runtime-node.js +21 -0
- package/_shims/auto/runtime-node.js.map +1 -0
- package/_shims/auto/runtime-node.mjs +2 -0
- package/_shims/auto/runtime-node.mjs.map +1 -0
- package/_shims/auto/runtime.d.ts +5 -0
- package/_shims/auto/runtime.d.ts.map +1 -0
- package/_shims/auto/runtime.js +21 -0
- package/_shims/auto/runtime.js.map +1 -0
- package/_shims/auto/runtime.mjs +2 -0
- package/_shims/auto/runtime.mjs.map +1 -0
- package/_shims/auto/types-node.d.ts +5 -0
- package/_shims/auto/types-node.d.ts.map +1 -0
- package/_shims/auto/types-node.js +21 -0
- package/_shims/auto/types-node.js.map +1 -0
- package/_shims/auto/types-node.mjs +2 -0
- package/_shims/auto/types-node.mjs.map +1 -0
- package/_shims/auto/types.d.ts +101 -0
- package/{src/_shims/ReadableStream.js → _shims/auto/types.js} +0 -2
- package/_shims/{ReadableStream.js → auto/types.mjs} +0 -2
- package/_shims/bun-runtime.d.ts +6 -0
- package/_shims/bun-runtime.d.ts.map +1 -0
- package/_shims/bun-runtime.js +14 -0
- package/_shims/bun-runtime.js.map +1 -0
- package/_shims/bun-runtime.mjs +10 -0
- package/_shims/bun-runtime.mjs.map +1 -0
- package/_shims/index.d.ts +81 -0
- package/_shims/index.js +13 -0
- package/_shims/index.mjs +7 -0
- package/_shims/manual-types.d.ts +12 -0
- package/_shims/manual-types.js +3 -0
- package/_shims/manual-types.mjs +3 -0
- package/_shims/node-runtime.d.ts +3 -0
- package/_shims/node-runtime.d.ts.map +1 -0
- package/_shims/node-runtime.js +89 -0
- package/_shims/node-runtime.js.map +1 -0
- package/_shims/node-runtime.mjs +56 -0
- package/_shims/node-runtime.mjs.map +1 -0
- package/_shims/node-types.d.ts +42 -0
- package/_shims/node-types.js +3 -0
- package/_shims/node-types.mjs +3 -0
- package/_shims/registry.d.ts +37 -0
- package/_shims/registry.d.ts.map +1 -0
- package/_shims/registry.js +41 -0
- package/_shims/registry.js.map +1 -0
- package/_shims/registry.mjs +37 -0
- package/_shims/registry.mjs.map +1 -0
- package/_shims/web-runtime.d.ts +5 -0
- package/_shims/web-runtime.d.ts.map +1 -0
- package/_shims/web-runtime.js +78 -0
- package/_shims/web-runtime.js.map +1 -0
- package/_shims/web-runtime.mjs +71 -0
- package/_shims/web-runtime.mjs.map +1 -0
- package/_shims/web-types.d.ts +83 -0
- package/_shims/web-types.js +3 -0
- package/_shims/web-types.mjs +3 -0
- package/core.d.ts +172 -216
- package/core.d.ts.map +1 -1
- package/core.js +701 -729
- package/core.js.map +1 -1
- package/core.mjs +694 -681
- package/core.mjs.map +1 -1
- package/error.d.ts +32 -32
- package/error.d.ts.map +1 -1
- package/error.js +105 -106
- package/error.js.map +1 -1
- package/error.mjs +101 -91
- package/error.mjs.map +1 -1
- package/index.d.mts +110 -117
- package/index.d.ts +110 -117
- package/index.d.ts.map +1 -1
- package/index.js +107 -160
- package/index.js.map +1 -1
- package/index.mjs +84 -105
- package/index.mjs.map +1 -1
- package/package.json +36 -21
- package/resource.d.ts +10 -10
- package/resource.js +12 -12
- package/resource.mjs +10 -10
- package/resources/completions.d.ts +136 -142
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js +9 -14
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs +6 -11
- package/resources/completions.mjs.map +1 -1
- package/resources/index.d.ts +2 -9
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -10
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -2
- package/resources/index.mjs.map +1 -1
- package/resources/top-level.d.ts +1 -1
- package/resources/top-level.js +3 -3
- package/resources/top-level.mjs +1 -1
- package/shims/node.d.ts +29 -0
- package/shims/node.d.ts.map +1 -0
- package/shims/node.js +31 -0
- package/shims/node.js.map +1 -0
- package/shims/node.mjs +5 -0
- package/shims/node.mjs.map +1 -0
- package/shims/web.d.ts +26 -0
- package/shims/web.d.ts.map +1 -0
- package/shims/web.js +31 -0
- package/shims/web.js.map +1 -0
- package/shims/web.mjs +5 -0
- package/shims/web.mjs.map +1 -0
- package/src/_shims/MultipartBody.ts +9 -0
- package/src/_shims/README.md +46 -0
- package/src/_shims/auto/runtime-bun.ts +4 -0
- package/src/_shims/auto/runtime-node.ts +4 -0
- package/src/_shims/auto/runtime.ts +4 -0
- package/src/_shims/auto/types-node.ts +4 -0
- package/src/_shims/auto/types.d.ts +101 -0
- package/src/_shims/auto/types.js +3 -0
- package/src/_shims/auto/types.mjs +3 -0
- package/src/_shims/bun-runtime.ts +14 -0
- package/src/_shims/index.d.ts +81 -0
- package/src/_shims/index.js +13 -0
- package/src/_shims/index.mjs +7 -0
- package/src/_shims/manual-types.d.ts +12 -0
- package/src/_shims/manual-types.js +3 -0
- package/src/_shims/manual-types.mjs +3 -0
- package/src/_shims/node-runtime.ts +81 -0
- package/src/_shims/node-types.d.ts +42 -0
- package/src/_shims/node-types.js +3 -0
- package/src/_shims/node-types.mjs +3 -0
- package/src/_shims/registry.ts +67 -0
- package/src/_shims/web-runtime.ts +103 -0
- package/src/_shims/web-types.d.ts +83 -0
- package/src/_shims/web-types.js +3 -0
- package/src/_shims/web-types.mjs +3 -0
- package/src/core.ts +124 -61
- package/src/error.ts +20 -8
- package/src/index.ts +27 -22
- package/src/resources/completions.ts +11 -11
- package/src/resources/index.ts +0 -1
- package/src/shims/node.ts +50 -0
- package/src/shims/web.ts +50 -0
- package/src/streaming.ts +166 -56
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +11 -15
- package/src/version.ts +1 -1
- package/streaming.d.ts +11 -8
- package/streaming.d.ts.map +1 -1
- package/streaming.js +300 -192
- package/streaming.js.map +1 -1
- package/streaming.mjs +296 -188
- package/streaming.mjs.map +1 -1
- package/uploads.d.ts +23 -39
- package/uploads.d.ts.map +1 -1
- package/uploads.js +111 -157
- package/uploads.js.map +1 -1
- package/uploads.mjs +107 -133
- package/uploads.mjs.map +1 -1
- package/version.d.ts +2 -2
- package/version.js +4 -4
- package/version.mjs +2 -2
- package/_shims/ReadableStream.d.ts +0 -38
- package/_shims/ReadableStream.mjs +0 -7
- package/_shims/ReadableStream.node.d.ts +0 -6
- package/_shims/ReadableStream.node.d.ts.map +0 -1
- package/_shims/ReadableStream.node.js +0 -14
- package/_shims/ReadableStream.node.js.map +0 -1
- package/_shims/ReadableStream.node.mjs +0 -3
- package/_shims/ReadableStream.node.mjs.map +0 -1
- package/_shims/agent.d.ts +0 -9
- package/_shims/agent.d.ts.map +0 -1
- package/_shims/agent.js +0 -14
- package/_shims/agent.js.map +0 -1
- package/_shims/agent.mjs +0 -10
- package/_shims/agent.mjs.map +0 -1
- package/_shims/agent.node.d.ts +0 -7
- package/_shims/agent.node.d.ts.map +0 -1
- package/_shims/agent.node.js +0 -28
- package/_shims/agent.node.js.map +0 -1
- package/_shims/agent.node.mjs +0 -16
- package/_shims/agent.node.mjs.map +0 -1
- package/_shims/fetch.d.ts +0 -59
- package/_shims/fetch.js +0 -13
- package/_shims/fetch.mjs +0 -15
- package/_shims/fetch.node.d.ts +0 -63
- package/_shims/fetch.node.js +0 -12
- package/_shims/fetch.node.mjs +0 -14
- package/_shims/fileFromPath.d.ts +0 -22
- package/_shims/fileFromPath.d.ts.map +0 -1
- package/_shims/fileFromPath.js +0 -16
- package/_shims/fileFromPath.js.map +0 -1
- package/_shims/fileFromPath.mjs +0 -12
- package/_shims/fileFromPath.mjs.map +0 -1
- package/_shims/fileFromPath.node.d.ts +0 -17
- package/_shims/fileFromPath.node.d.ts.map +0 -1
- package/_shims/fileFromPath.node.js +0 -17
- package/_shims/fileFromPath.node.js.map +0 -1
- package/_shims/fileFromPath.node.mjs +0 -13
- package/_shims/fileFromPath.node.mjs.map +0 -1
- package/_shims/formdata.d.ts +0 -43
- package/_shims/formdata.js +0 -17
- package/_shims/formdata.mjs +0 -20
- package/_shims/formdata.node.d.ts +0 -45
- package/_shims/formdata.node.js +0 -11
- package/_shims/formdata.node.mjs +0 -9
- package/_shims/getMultipartRequestOptions.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.js +0 -12
- package/_shims/getMultipartRequestOptions.js.map +0 -1
- package/_shims/getMultipartRequestOptions.mjs +0 -8
- package/_shims/getMultipartRequestOptions.mjs.map +0 -1
- package/_shims/getMultipartRequestOptions.node.d.ts +0 -10
- package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
- package/_shims/getMultipartRequestOptions.node.js +0 -22
- package/_shims/getMultipartRequestOptions.node.js.map +0 -1
- package/_shims/getMultipartRequestOptions.node.mjs +0 -18
- package/_shims/getMultipartRequestOptions.node.mjs.map +0 -1
- package/_shims/node-readable.d.ts +0 -23
- package/_shims/node-readable.d.ts.map +0 -1
- package/_shims/node-readable.js +0 -11
- package/_shims/node-readable.js.map +0 -1
- package/_shims/node-readable.mjs +0 -7
- package/_shims/node-readable.mjs.map +0 -1
- package/_shims/node-readable.node.d.ts +0 -8
- package/_shims/node-readable.node.d.ts.map +0 -1
- package/_shims/node-readable.node.js +0 -9
- package/_shims/node-readable.node.js.map +0 -1
- package/_shims/node-readable.node.mjs +0 -5
- package/_shims/node-readable.node.mjs.map +0 -1
- package/src/_shims/ReadableStream.d.ts +0 -38
- package/src/_shims/ReadableStream.mjs +0 -7
- package/src/_shims/agent.node.ts +0 -22
- package/src/_shims/agent.ts +0 -12
- package/src/_shims/fetch.d.ts +0 -59
- package/src/_shims/fetch.deno.ts +0 -23
- package/src/_shims/fetch.js +0 -13
- package/src/_shims/fetch.mjs +0 -15
- package/src/_shims/fetch.node.d.ts +0 -63
- package/src/_shims/fetch.node.js +0 -12
- package/src/_shims/fetch.node.mjs +0 -14
- package/src/_shims/fileFromPath.node.ts +0 -29
- package/src/_shims/fileFromPath.ts +0 -29
- package/src/_shims/formdata.d.ts +0 -43
- package/src/_shims/formdata.deno.ts +0 -16
- package/src/_shims/formdata.js +0 -17
- package/src/_shims/formdata.mjs +0 -20
- package/src/_shims/formdata.node.d.ts +0 -45
- package/src/_shims/formdata.node.js +0 -11
- package/src/_shims/formdata.node.mjs +0 -9
- package/src/_shims/getMultipartRequestOptions.node.ts +0 -25
- package/src/_shims/getMultipartRequestOptions.ts +0 -14
- package/src/_shims/node-readable.node.ts +0 -10
- package/src/_shims/node-readable.ts +0 -30
package/index.d.ts
CHANGED
|
@@ -1,128 +1,121 @@
|
|
|
1
|
-
import * as Core from
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
1
|
+
import * as Core from "./core.js";
|
|
2
|
+
import * as Errors from "./error.js";
|
|
3
|
+
import { type Agent } from "./_shims/index.js";
|
|
4
|
+
import * as Uploads from "./uploads.js";
|
|
5
|
+
import * as API from '@anthropic-ai/sdk/resources/index';
|
|
6
6
|
export interface ClientOptions {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Defaults to process.env['ANTHROPIC_API_KEY'].
|
|
9
|
+
*/
|
|
10
|
+
apiKey?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Defaults to process.env['ANTHROPIC_AUTH_TOKEN'].
|
|
13
|
+
*/
|
|
14
|
+
authToken?: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
17
|
+
*/
|
|
18
|
+
baseURL?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
21
|
+
* from the server before timing out a single request.
|
|
22
|
+
*
|
|
23
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
24
|
+
* much longer than this timeout before the promise succeeds or fails.
|
|
25
|
+
*/
|
|
26
|
+
timeout?: number;
|
|
27
|
+
/**
|
|
28
|
+
* An HTTP agent used to manage HTTP(S) connections.
|
|
29
|
+
*
|
|
30
|
+
* If not provided, an agent will be constructed by default in the Node.js environment,
|
|
31
|
+
* otherwise no agent is used.
|
|
32
|
+
*/
|
|
33
|
+
httpAgent?: Agent;
|
|
34
|
+
/**
|
|
35
|
+
* Specify a custom `fetch` function implementation.
|
|
36
|
+
*
|
|
37
|
+
* If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
|
|
38
|
+
* defined globally.
|
|
39
|
+
*/
|
|
40
|
+
fetch?: Core.Fetch | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
43
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
44
|
+
*
|
|
45
|
+
* @default 2
|
|
46
|
+
*/
|
|
47
|
+
maxRetries?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Default headers to include with every request to the API.
|
|
50
|
+
*
|
|
51
|
+
* These can be removed in individual requests by explicitly setting the
|
|
52
|
+
* header to `undefined` or `null` in request options.
|
|
53
|
+
*/
|
|
54
|
+
defaultHeaders?: Core.Headers;
|
|
55
|
+
/**
|
|
56
|
+
* Default query parameters to include with every request to the API.
|
|
57
|
+
*
|
|
58
|
+
* These can be removed in individual requests by explicitly setting the
|
|
59
|
+
* param to `undefined` in request options.
|
|
60
|
+
*/
|
|
61
|
+
defaultQuery?: Core.DefaultQuery;
|
|
59
62
|
}
|
|
60
63
|
/** API Client for interfacing with the Anthropic API. */
|
|
61
64
|
export declare class Anthropic extends Core.APIClient {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
65
|
+
apiKey: string | null;
|
|
66
|
+
authToken: string | null;
|
|
67
|
+
private _options;
|
|
68
|
+
/**
|
|
69
|
+
* API Client for interfacing with the Anthropic API.
|
|
70
|
+
*
|
|
71
|
+
* @param {string | null} [opts.apiKey==process.env['ANTHROPIC_API_KEY'] ?? null]
|
|
72
|
+
* @param {string | null} [opts.authToken==process.env['ANTHROPIC_AUTH_TOKEN'] ?? null]
|
|
73
|
+
* @param {string} [opts.baseURL] - Override the default base URL for the API.
|
|
74
|
+
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
75
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
76
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
77
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
78
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
79
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
80
|
+
*/
|
|
81
|
+
constructor({ apiKey, authToken, ...opts }?: ClientOptions);
|
|
82
|
+
completions: API.Completions;
|
|
83
|
+
protected defaultQuery(): Core.DefaultQuery | undefined;
|
|
84
|
+
protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
85
|
+
protected validateHeaders(headers: Core.Headers, customHeaders: Core.Headers): void;
|
|
86
|
+
protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
|
|
87
|
+
protected apiKeyAuth(opts: Core.FinalRequestOptions): Core.Headers;
|
|
88
|
+
protected bearerAuth(opts: Core.FinalRequestOptions): Core.Headers;
|
|
89
|
+
static Anthropic: typeof Anthropic;
|
|
90
|
+
static HUMAN_PROMPT: string;
|
|
91
|
+
static AI_PROMPT: string;
|
|
92
|
+
static AnthropicError: typeof Errors.AnthropicError;
|
|
93
|
+
static APIError: typeof Errors.APIError;
|
|
94
|
+
static APIConnectionError: typeof Errors.APIConnectionError;
|
|
95
|
+
static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
|
|
96
|
+
static APIUserAbortError: typeof Errors.APIUserAbortError;
|
|
97
|
+
static NotFoundError: typeof Errors.NotFoundError;
|
|
98
|
+
static ConflictError: typeof Errors.ConflictError;
|
|
99
|
+
static RateLimitError: typeof Errors.RateLimitError;
|
|
100
|
+
static BadRequestError: typeof Errors.BadRequestError;
|
|
101
|
+
static AuthenticationError: typeof Errors.AuthenticationError;
|
|
102
|
+
static InternalServerError: typeof Errors.InternalServerError;
|
|
103
|
+
static PermissionDeniedError: typeof Errors.PermissionDeniedError;
|
|
104
|
+
static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
101
105
|
}
|
|
102
106
|
export declare const HUMAN_PROMPT: string, AI_PROMPT: string;
|
|
103
|
-
export declare const APIError: typeof Errors.APIError,
|
|
104
|
-
APIConnectionError: typeof Errors.APIConnectionError,
|
|
105
|
-
APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError,
|
|
106
|
-
APIUserAbortError: typeof Errors.APIUserAbortError,
|
|
107
|
-
NotFoundError: typeof Errors.NotFoundError,
|
|
108
|
-
ConflictError: typeof Errors.ConflictError,
|
|
109
|
-
RateLimitError: typeof Errors.RateLimitError,
|
|
110
|
-
BadRequestError: typeof Errors.BadRequestError,
|
|
111
|
-
AuthenticationError: typeof Errors.AuthenticationError,
|
|
112
|
-
InternalServerError: typeof Errors.InternalServerError,
|
|
113
|
-
PermissionDeniedError: typeof Errors.PermissionDeniedError,
|
|
114
|
-
UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
107
|
+
export declare const AnthropicError: typeof Errors.AnthropicError, APIError: typeof Errors.APIError, APIConnectionError: typeof Errors.APIConnectionError, APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError, APIUserAbortError: typeof Errors.APIUserAbortError, NotFoundError: typeof Errors.NotFoundError, ConflictError: typeof Errors.ConflictError, RateLimitError: typeof Errors.RateLimitError, BadRequestError: typeof Errors.BadRequestError, AuthenticationError: typeof Errors.AuthenticationError, InternalServerError: typeof Errors.InternalServerError, PermissionDeniedError: typeof Errors.PermissionDeniedError, UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
|
|
115
108
|
export import toFile = Uploads.toFile;
|
|
116
109
|
export import fileFromPath = Uploads.fileFromPath;
|
|
117
110
|
export declare namespace Anthropic {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
111
|
+
export import toFile = Uploads.toFile;
|
|
112
|
+
export import fileFromPath = Uploads.fileFromPath;
|
|
113
|
+
export import RequestOptions = Core.RequestOptions;
|
|
114
|
+
export import Completions = API.Completions;
|
|
115
|
+
export import Completion = API.Completion;
|
|
116
|
+
export import CompletionCreateParams = API.CompletionCreateParams;
|
|
117
|
+
export import CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
|
|
118
|
+
export import CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
|
|
126
119
|
}
|
|
127
120
|
export default Anthropic;
|
|
128
|
-
//# sourceMappingURL=index.d.ts.map
|
|
121
|
+
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,KAAK,MAAM,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,mCAAmC,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC5B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,CAAC,WAAW,CAAC;IAC5C,MAAM,QAAQ,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAC1C,MAAM,QAAQ,sBAAsB,GAAG,GAAG,CAAC,sBAAsB,CAAC;IAClE,MAAM,QAAQ,kCAAkC,GAAG,GAAG,CAAC,kCAAkC,CAAC;IAC1F,MAAM,QAAQ,+BAA+B,GAAG,GAAG,CAAC,+BAA+B,CAAC;CACrF;AAED,eAAe,SAAS,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,166 +1,124 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
// File generated from our OpenAPI spec by Stainless.
|
|
3
|
-
var __createBinding =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return m[k];
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
Object.defineProperty(o, k2, desc);
|
|
18
|
-
}
|
|
19
|
-
: function (o, m, k, k2) {
|
|
20
|
-
if (k2 === undefined) k2 = k;
|
|
21
|
-
o[k2] = m[k];
|
|
22
|
-
});
|
|
23
|
-
var __setModuleDefault =
|
|
24
|
-
(this && this.__setModuleDefault) ||
|
|
25
|
-
(Object.create ?
|
|
26
|
-
function (o, v) {
|
|
27
|
-
Object.defineProperty(o, 'default', { enumerable: true, value: v });
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
28
8
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
35
20
|
if (mod && mod.__esModule) return mod;
|
|
36
21
|
var result = {};
|
|
37
|
-
if (mod != null)
|
|
38
|
-
for (var k in mod)
|
|
39
|
-
if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
40
23
|
__setModuleDefault(result, mod);
|
|
41
24
|
return result;
|
|
42
|
-
|
|
25
|
+
};
|
|
43
26
|
var _a;
|
|
44
|
-
Object.defineProperty(exports,
|
|
45
|
-
exports.fileFromPath =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
exports.AuthenticationError =
|
|
51
|
-
exports.BadRequestError =
|
|
52
|
-
exports.RateLimitError =
|
|
53
|
-
exports.ConflictError =
|
|
54
|
-
exports.NotFoundError =
|
|
55
|
-
exports.APIUserAbortError =
|
|
56
|
-
exports.APIConnectionTimeoutError =
|
|
57
|
-
exports.APIConnectionError =
|
|
58
|
-
exports.APIError =
|
|
59
|
-
exports.AI_PROMPT =
|
|
60
|
-
exports.HUMAN_PROMPT =
|
|
61
|
-
exports.Anthropic =
|
|
62
|
-
void 0;
|
|
63
|
-
const Core = __importStar(require('./core.js'));
|
|
64
|
-
const API = __importStar(require('./resources/index.js'));
|
|
65
|
-
const Errors = __importStar(require('./error.js'));
|
|
66
|
-
const Uploads = __importStar(require('./uploads.js'));
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.fileFromPath = exports.toFile = exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.AnthropicError = exports.AI_PROMPT = exports.HUMAN_PROMPT = exports.Anthropic = void 0;
|
|
29
|
+
const Core = __importStar(require("./core.js"));
|
|
30
|
+
const Errors = __importStar(require("./error.js"));
|
|
31
|
+
const Uploads = __importStar(require("./uploads.js"));
|
|
32
|
+
const API = __importStar(require("@anthropic-ai/sdk/resources/index"));
|
|
67
33
|
/** API Client for interfacing with the Anthropic API. */
|
|
68
34
|
class Anthropic extends Core.APIClient {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
maxRetries: options.maxRetries,
|
|
101
|
-
fetch: options.fetch,
|
|
102
|
-
});
|
|
103
|
-
this.completions = new API.Completions(this);
|
|
104
|
-
this._options = options;
|
|
105
|
-
this.apiKey = apiKey;
|
|
106
|
-
this.authToken = authToken;
|
|
107
|
-
}
|
|
108
|
-
defaultQuery() {
|
|
109
|
-
return this._options.defaultQuery;
|
|
110
|
-
}
|
|
111
|
-
defaultHeaders() {
|
|
112
|
-
return {
|
|
113
|
-
...super.defaultHeaders(),
|
|
114
|
-
'anthropic-version': '2023-06-01',
|
|
115
|
-
...this._options.defaultHeaders,
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
validateHeaders(headers, customHeaders) {
|
|
119
|
-
if (this.apiKey && headers['X-Api-Key']) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (customHeaders['X-Api-Key'] === null) {
|
|
123
|
-
return;
|
|
35
|
+
/**
|
|
36
|
+
* API Client for interfacing with the Anthropic API.
|
|
37
|
+
*
|
|
38
|
+
* @param {string | null} [opts.apiKey==process.env['ANTHROPIC_API_KEY'] ?? null]
|
|
39
|
+
* @param {string | null} [opts.authToken==process.env['ANTHROPIC_AUTH_TOKEN'] ?? null]
|
|
40
|
+
* @param {string} [opts.baseURL] - Override the default base URL for the API.
|
|
41
|
+
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
42
|
+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
43
|
+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
44
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
45
|
+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
46
|
+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
47
|
+
*/
|
|
48
|
+
constructor({ apiKey = Core.readEnv('ANTHROPIC_API_KEY') ?? null, authToken = Core.readEnv('ANTHROPIC_AUTH_TOKEN') ?? null, ...opts } = {}) {
|
|
49
|
+
const options = {
|
|
50
|
+
apiKey,
|
|
51
|
+
authToken,
|
|
52
|
+
...opts,
|
|
53
|
+
baseURL: opts.baseURL ?? `https://api.anthropic.com`,
|
|
54
|
+
};
|
|
55
|
+
super({
|
|
56
|
+
baseURL: options.baseURL,
|
|
57
|
+
timeout: options.timeout ?? 600000 /* 10 minutes */,
|
|
58
|
+
httpAgent: options.httpAgent,
|
|
59
|
+
maxRetries: options.maxRetries,
|
|
60
|
+
fetch: options.fetch,
|
|
61
|
+
});
|
|
62
|
+
this.completions = new API.Completions(this);
|
|
63
|
+
this._options = options;
|
|
64
|
+
this.apiKey = apiKey;
|
|
65
|
+
this.authToken = authToken;
|
|
124
66
|
}
|
|
125
|
-
|
|
126
|
-
|
|
67
|
+
defaultQuery() {
|
|
68
|
+
return this._options.defaultQuery;
|
|
127
69
|
}
|
|
128
|
-
|
|
129
|
-
|
|
70
|
+
defaultHeaders(opts) {
|
|
71
|
+
return {
|
|
72
|
+
...super.defaultHeaders(opts),
|
|
73
|
+
'anthropic-version': '2023-06-01',
|
|
74
|
+
...this._options.defaultHeaders,
|
|
75
|
+
};
|
|
130
76
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
77
|
+
validateHeaders(headers, customHeaders) {
|
|
78
|
+
if (this.apiKey && headers['X-Api-Key']) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (customHeaders['X-Api-Key'] === null) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (this.authToken && headers['Authorization']) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (customHeaders['Authorization'] === null) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
throw new Error('Could not resolve authentication method. Expected either apiKey or authToken to be set. Or for one of the "X-Api-Key" or "Authorization" headers to be explicitly omitted');
|
|
139
91
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
92
|
+
authHeaders(opts) {
|
|
93
|
+
const apiKeyAuth = this.apiKeyAuth(opts);
|
|
94
|
+
const bearerAuth = this.bearerAuth(opts);
|
|
95
|
+
if (apiKeyAuth != null && !Core.isEmptyObj(apiKeyAuth)) {
|
|
96
|
+
return apiKeyAuth;
|
|
97
|
+
}
|
|
98
|
+
if (bearerAuth != null && !Core.isEmptyObj(bearerAuth)) {
|
|
99
|
+
return bearerAuth;
|
|
100
|
+
}
|
|
101
|
+
return {};
|
|
143
102
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
103
|
+
apiKeyAuth(opts) {
|
|
104
|
+
if (this.apiKey == null) {
|
|
105
|
+
return {};
|
|
106
|
+
}
|
|
107
|
+
return { 'X-Api-Key': this.apiKey };
|
|
149
108
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
109
|
+
bearerAuth(opts) {
|
|
110
|
+
if (this.authToken == null) {
|
|
111
|
+
return {};
|
|
112
|
+
}
|
|
113
|
+
return { Authorization: `Bearer ${this.authToken}` };
|
|
155
114
|
}
|
|
156
|
-
return { Authorization: `Bearer ${this.authToken}` };
|
|
157
|
-
}
|
|
158
115
|
}
|
|
159
116
|
exports.Anthropic = Anthropic;
|
|
160
117
|
_a = Anthropic;
|
|
161
118
|
Anthropic.Anthropic = _a;
|
|
162
119
|
Anthropic.HUMAN_PROMPT = '\n\nHuman:';
|
|
163
120
|
Anthropic.AI_PROMPT = '\n\nAssistant:';
|
|
121
|
+
Anthropic.AnthropicError = Errors.AnthropicError;
|
|
164
122
|
Anthropic.APIError = Errors.APIError;
|
|
165
123
|
Anthropic.APIConnectionError = Errors.APIConnectionError;
|
|
166
124
|
Anthropic.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
@@ -173,27 +131,16 @@ Anthropic.AuthenticationError = Errors.AuthenticationError;
|
|
|
173
131
|
Anthropic.InternalServerError = Errors.InternalServerError;
|
|
174
132
|
Anthropic.PermissionDeniedError = Errors.PermissionDeniedError;
|
|
175
133
|
Anthropic.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
(exports.APIConnectionError = Errors.APIConnectionError),
|
|
179
|
-
(exports.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError),
|
|
180
|
-
(exports.APIUserAbortError = Errors.APIUserAbortError),
|
|
181
|
-
(exports.NotFoundError = Errors.NotFoundError),
|
|
182
|
-
(exports.ConflictError = Errors.ConflictError),
|
|
183
|
-
(exports.RateLimitError = Errors.RateLimitError),
|
|
184
|
-
(exports.BadRequestError = Errors.BadRequestError),
|
|
185
|
-
(exports.AuthenticationError = Errors.AuthenticationError),
|
|
186
|
-
(exports.InternalServerError = Errors.InternalServerError),
|
|
187
|
-
(exports.PermissionDeniedError = Errors.PermissionDeniedError),
|
|
188
|
-
(exports.UnprocessableEntityError = Errors.UnprocessableEntityError);
|
|
134
|
+
exports.HUMAN_PROMPT = Anthropic.HUMAN_PROMPT, exports.AI_PROMPT = Anthropic.AI_PROMPT;
|
|
135
|
+
exports.AnthropicError = Errors.AnthropicError, exports.APIError = Errors.APIError, exports.APIConnectionError = Errors.APIConnectionError, exports.APIConnectionTimeoutError = Errors.APIConnectionTimeoutError, exports.APIUserAbortError = Errors.APIUserAbortError, exports.NotFoundError = Errors.NotFoundError, exports.ConflictError = Errors.ConflictError, exports.RateLimitError = Errors.RateLimitError, exports.BadRequestError = Errors.BadRequestError, exports.AuthenticationError = Errors.AuthenticationError, exports.InternalServerError = Errors.InternalServerError, exports.PermissionDeniedError = Errors.PermissionDeniedError, exports.UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
189
136
|
exports.toFile = Uploads.toFile;
|
|
190
137
|
exports.fileFromPath = Uploads.fileFromPath;
|
|
191
138
|
(function (Anthropic) {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
})(
|
|
139
|
+
// Helper functions
|
|
140
|
+
Anthropic.toFile = Uploads.toFile;
|
|
141
|
+
Anthropic.fileFromPath = Uploads.fileFromPath;
|
|
142
|
+
Anthropic.Completions = API.Completions;
|
|
143
|
+
})(Anthropic = exports.Anthropic || (exports.Anthropic = {}));
|
|
197
144
|
exports = module.exports = Anthropic;
|
|
198
145
|
exports.default = Anthropic;
|
|
199
|
-
//# sourceMappingURL=index.js.map
|
|
146
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErD,gDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;AAErD,gDAA+B;AAC/B,mDAAkC;AAElC,sDAAqC;AACrC,uEAAyD;AAoEzD,yDAAyD;AACzD,MAAa,SAAU,SAAQ,IAAI,CAAC,SAAS;IAM3C;;;;;;;;;;;;OAYG;IACH,YAAY,EACV,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,IAAI,EAClD,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,IAAI,IAAI,EACxD,GAAG,IAAI,KACU,EAAE;QACnB,MAAM,OAAO,GAAkB;YAC7B,MAAM;YACN,SAAS;YACT,GAAG,IAAI;YACP,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,2BAA2B;SACrD,CAAC;QAEF,KAAK,CAAC;YACJ,OAAO,EAAE,OAAO,CAAC,OAAQ;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,gBAAgB;YACnD,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;SACrB,CAAC,CAAC;QAOL,gBAAW,GAAoB,IAAI,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,C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