@anthropic-ai/sdk 0.6.2 → 0.6.8

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.
Files changed (265) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/README.md +16 -6
  3. package/_shims/MultipartBody.d.ts +9 -0
  4. package/_shims/MultipartBody.d.ts.map +1 -0
  5. package/_shims/MultipartBody.js +16 -0
  6. package/_shims/MultipartBody.js.map +1 -0
  7. package/_shims/MultipartBody.mjs +12 -0
  8. package/_shims/MultipartBody.mjs.map +1 -0
  9. package/_shims/README.md +46 -0
  10. package/{src/_shims/ReadableStream.node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
  11. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  12. package/_shims/auto/runtime-bun.js +21 -0
  13. package/_shims/auto/runtime-bun.js.map +1 -0
  14. package/_shims/auto/runtime-bun.mjs +2 -0
  15. package/_shims/auto/runtime-bun.mjs.map +1 -0
  16. package/_shims/auto/runtime-node.d.ts +5 -0
  17. package/_shims/auto/runtime-node.d.ts.map +1 -0
  18. package/_shims/auto/runtime-node.js +21 -0
  19. package/_shims/auto/runtime-node.js.map +1 -0
  20. package/_shims/auto/runtime-node.mjs +2 -0
  21. package/_shims/auto/runtime-node.mjs.map +1 -0
  22. package/_shims/auto/runtime.d.ts +5 -0
  23. package/_shims/auto/runtime.d.ts.map +1 -0
  24. package/_shims/auto/runtime.js +21 -0
  25. package/_shims/auto/runtime.js.map +1 -0
  26. package/_shims/auto/runtime.mjs +2 -0
  27. package/_shims/auto/runtime.mjs.map +1 -0
  28. package/_shims/auto/types-node.d.ts +5 -0
  29. package/_shims/auto/types-node.d.ts.map +1 -0
  30. package/_shims/auto/types-node.js +21 -0
  31. package/_shims/auto/types-node.js.map +1 -0
  32. package/_shims/auto/types-node.mjs +2 -0
  33. package/_shims/auto/types-node.mjs.map +1 -0
  34. package/_shims/auto/types.d.ts +101 -0
  35. package/{src/_shims/ReadableStream.js → _shims/auto/types.js} +0 -2
  36. package/_shims/{ReadableStream.js → auto/types.mjs} +0 -2
  37. package/_shims/bun-runtime.d.ts +6 -0
  38. package/_shims/bun-runtime.d.ts.map +1 -0
  39. package/_shims/bun-runtime.js +14 -0
  40. package/_shims/bun-runtime.js.map +1 -0
  41. package/_shims/bun-runtime.mjs +10 -0
  42. package/_shims/bun-runtime.mjs.map +1 -0
  43. package/_shims/index.d.ts +81 -0
  44. package/_shims/index.js +13 -0
  45. package/_shims/index.mjs +7 -0
  46. package/_shims/manual-types.d.ts +12 -0
  47. package/_shims/manual-types.js +3 -0
  48. package/_shims/manual-types.mjs +3 -0
  49. package/_shims/node-runtime.d.ts +3 -0
  50. package/_shims/node-runtime.d.ts.map +1 -0
  51. package/_shims/node-runtime.js +90 -0
  52. package/_shims/node-runtime.js.map +1 -0
  53. package/_shims/node-runtime.mjs +56 -0
  54. package/_shims/node-runtime.mjs.map +1 -0
  55. package/_shims/node-types.d.ts +42 -0
  56. package/_shims/node-types.js +3 -0
  57. package/_shims/node-types.mjs +3 -0
  58. package/_shims/registry.d.ts +37 -0
  59. package/_shims/registry.d.ts.map +1 -0
  60. package/_shims/registry.js +41 -0
  61. package/_shims/registry.js.map +1 -0
  62. package/_shims/registry.mjs +37 -0
  63. package/_shims/registry.mjs.map +1 -0
  64. package/_shims/web-runtime.d.ts +5 -0
  65. package/_shims/web-runtime.d.ts.map +1 -0
  66. package/_shims/web-runtime.js +78 -0
  67. package/_shims/web-runtime.js.map +1 -0
  68. package/_shims/web-runtime.mjs +71 -0
  69. package/_shims/web-runtime.mjs.map +1 -0
  70. package/_shims/web-types.d.ts +83 -0
  71. package/_shims/web-types.js +3 -0
  72. package/_shims/web-types.mjs +3 -0
  73. package/core.d.ts +172 -224
  74. package/core.d.ts.map +1 -1
  75. package/core.js +701 -736
  76. package/core.js.map +1 -1
  77. package/core.mjs +694 -688
  78. package/core.mjs.map +1 -1
  79. package/error.d.ts +32 -32
  80. package/error.d.ts.map +1 -1
  81. package/error.js +105 -106
  82. package/error.js.map +1 -1
  83. package/error.mjs +101 -91
  84. package/error.mjs.map +1 -1
  85. package/index.d.mts +110 -117
  86. package/index.d.ts +110 -117
  87. package/index.d.ts.map +1 -1
  88. package/index.js +107 -159
  89. package/index.js.map +1 -1
  90. package/index.mjs +84 -104
  91. package/index.mjs.map +1 -1
  92. package/package.json +36 -21
  93. package/resource.d.ts +10 -10
  94. package/resource.js +12 -12
  95. package/resource.mjs +10 -10
  96. package/resources/completions.d.ts +136 -142
  97. package/resources/completions.d.ts.map +1 -1
  98. package/resources/completions.js +9 -14
  99. package/resources/completions.js.map +1 -1
  100. package/resources/completions.mjs +6 -11
  101. package/resources/completions.mjs.map +1 -1
  102. package/resources/index.d.ts +2 -9
  103. package/resources/index.d.ts.map +1 -1
  104. package/resources/index.js +5 -10
  105. package/resources/index.js.map +1 -1
  106. package/resources/index.mjs +2 -2
  107. package/resources/index.mjs.map +1 -1
  108. package/resources/top-level.d.ts +1 -1
  109. package/resources/top-level.js +3 -3
  110. package/resources/top-level.mjs +1 -1
  111. package/shims/node.d.ts +29 -0
  112. package/shims/node.d.ts.map +1 -0
  113. package/shims/node.js +31 -0
  114. package/shims/node.js.map +1 -0
  115. package/shims/node.mjs +5 -0
  116. package/shims/node.mjs.map +1 -0
  117. package/shims/web.d.ts +26 -0
  118. package/shims/web.d.ts.map +1 -0
  119. package/shims/web.js +31 -0
  120. package/shims/web.js.map +1 -0
  121. package/shims/web.mjs +5 -0
  122. package/shims/web.mjs.map +1 -0
  123. package/src/_shims/MultipartBody.ts +9 -0
  124. package/src/_shims/README.md +46 -0
  125. package/src/_shims/auto/runtime-bun.ts +4 -0
  126. package/src/_shims/auto/runtime-node.ts +4 -0
  127. package/src/_shims/auto/runtime.ts +4 -0
  128. package/src/_shims/auto/types-node.ts +4 -0
  129. package/src/_shims/auto/types.d.ts +101 -0
  130. package/src/_shims/auto/types.js +3 -0
  131. package/src/_shims/auto/types.mjs +3 -0
  132. package/src/_shims/bun-runtime.ts +14 -0
  133. package/src/_shims/index.d.ts +81 -0
  134. package/src/_shims/index.js +13 -0
  135. package/src/_shims/index.mjs +7 -0
  136. package/src/_shims/manual-types.d.ts +12 -0
  137. package/src/_shims/manual-types.js +3 -0
  138. package/src/_shims/manual-types.mjs +3 -0
  139. package/src/_shims/node-runtime.ts +83 -0
  140. package/src/_shims/node-types.d.ts +42 -0
  141. package/src/_shims/node-types.js +3 -0
  142. package/src/_shims/node-types.mjs +3 -0
  143. package/src/_shims/registry.ts +67 -0
  144. package/src/_shims/web-runtime.ts +103 -0
  145. package/src/_shims/web-types.d.ts +83 -0
  146. package/src/_shims/web-types.js +3 -0
  147. package/src/_shims/web-types.mjs +3 -0
  148. package/src/core.ts +107 -56
  149. package/src/error.ts +20 -8
  150. package/src/index.ts +24 -17
  151. package/src/resources/completions.ts +11 -11
  152. package/src/resources/index.ts +0 -1
  153. package/src/shims/node.ts +50 -0
  154. package/src/shims/web.ts +50 -0
  155. package/src/streaming.ts +164 -59
  156. package/src/tsconfig.json +11 -0
  157. package/src/uploads.ts +11 -15
  158. package/src/version.ts +1 -1
  159. package/streaming.d.ts +11 -8
  160. package/streaming.d.ts.map +1 -1
  161. package/streaming.js +300 -192
  162. package/streaming.js.map +1 -1
  163. package/streaming.mjs +296 -188
  164. package/streaming.mjs.map +1 -1
  165. package/uploads.d.ts +23 -39
  166. package/uploads.d.ts.map +1 -1
  167. package/uploads.js +111 -157
  168. package/uploads.js.map +1 -1
  169. package/uploads.mjs +107 -133
  170. package/uploads.mjs.map +1 -1
  171. package/version.d.ts +2 -2
  172. package/version.js +4 -4
  173. package/version.mjs +2 -2
  174. package/_shims/ReadableStream.d.ts +0 -38
  175. package/_shims/ReadableStream.mjs +0 -7
  176. package/_shims/ReadableStream.node.d.ts +0 -6
  177. package/_shims/ReadableStream.node.d.ts.map +0 -1
  178. package/_shims/ReadableStream.node.js +0 -14
  179. package/_shims/ReadableStream.node.js.map +0 -1
  180. package/_shims/ReadableStream.node.mjs +0 -3
  181. package/_shims/ReadableStream.node.mjs.map +0 -1
  182. package/_shims/agent.d.ts +0 -9
  183. package/_shims/agent.d.ts.map +0 -1
  184. package/_shims/agent.js +0 -14
  185. package/_shims/agent.js.map +0 -1
  186. package/_shims/agent.mjs +0 -10
  187. package/_shims/agent.mjs.map +0 -1
  188. package/_shims/agent.node.d.ts +0 -7
  189. package/_shims/agent.node.d.ts.map +0 -1
  190. package/_shims/agent.node.js +0 -28
  191. package/_shims/agent.node.js.map +0 -1
  192. package/_shims/agent.node.mjs +0 -16
  193. package/_shims/agent.node.mjs.map +0 -1
  194. package/_shims/fetch.d.ts +0 -60
  195. package/_shims/fetch.js +0 -13
  196. package/_shims/fetch.mjs +0 -15
  197. package/_shims/fetch.node.d.ts +0 -64
  198. package/_shims/fetch.node.js +0 -12
  199. package/_shims/fetch.node.mjs +0 -14
  200. package/_shims/fileFromPath.d.ts +0 -22
  201. package/_shims/fileFromPath.d.ts.map +0 -1
  202. package/_shims/fileFromPath.js +0 -16
  203. package/_shims/fileFromPath.js.map +0 -1
  204. package/_shims/fileFromPath.mjs +0 -12
  205. package/_shims/fileFromPath.mjs.map +0 -1
  206. package/_shims/fileFromPath.node.d.ts +0 -17
  207. package/_shims/fileFromPath.node.d.ts.map +0 -1
  208. package/_shims/fileFromPath.node.js +0 -17
  209. package/_shims/fileFromPath.node.js.map +0 -1
  210. package/_shims/fileFromPath.node.mjs +0 -13
  211. package/_shims/fileFromPath.node.mjs.map +0 -1
  212. package/_shims/formdata.d.ts +0 -43
  213. package/_shims/formdata.js +0 -17
  214. package/_shims/formdata.mjs +0 -20
  215. package/_shims/formdata.node.d.ts +0 -45
  216. package/_shims/formdata.node.js +0 -11
  217. package/_shims/formdata.node.mjs +0 -9
  218. package/_shims/getMultipartRequestOptions.d.ts +0 -10
  219. package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
  220. package/_shims/getMultipartRequestOptions.js +0 -12
  221. package/_shims/getMultipartRequestOptions.js.map +0 -1
  222. package/_shims/getMultipartRequestOptions.mjs +0 -8
  223. package/_shims/getMultipartRequestOptions.mjs.map +0 -1
  224. package/_shims/getMultipartRequestOptions.node.d.ts +0 -10
  225. package/_shims/getMultipartRequestOptions.node.d.ts.map +0 -1
  226. package/_shims/getMultipartRequestOptions.node.js +0 -22
  227. package/_shims/getMultipartRequestOptions.node.js.map +0 -1
  228. package/_shims/getMultipartRequestOptions.node.mjs +0 -18
  229. package/_shims/getMultipartRequestOptions.node.mjs.map +0 -1
  230. package/_shims/node-readable.d.ts +0 -23
  231. package/_shims/node-readable.d.ts.map +0 -1
  232. package/_shims/node-readable.js +0 -11
  233. package/_shims/node-readable.js.map +0 -1
  234. package/_shims/node-readable.mjs +0 -7
  235. package/_shims/node-readable.mjs.map +0 -1
  236. package/_shims/node-readable.node.d.ts +0 -8
  237. package/_shims/node-readable.node.d.ts.map +0 -1
  238. package/_shims/node-readable.node.js +0 -9
  239. package/_shims/node-readable.node.js.map +0 -1
  240. package/_shims/node-readable.node.mjs +0 -5
  241. package/_shims/node-readable.node.mjs.map +0 -1
  242. package/src/_shims/ReadableStream.d.ts +0 -38
  243. package/src/_shims/ReadableStream.mjs +0 -7
  244. package/src/_shims/agent.node.ts +0 -22
  245. package/src/_shims/agent.ts +0 -12
  246. package/src/_shims/fetch.d.ts +0 -60
  247. package/src/_shims/fetch.deno.ts +0 -23
  248. package/src/_shims/fetch.js +0 -13
  249. package/src/_shims/fetch.mjs +0 -15
  250. package/src/_shims/fetch.node.d.ts +0 -64
  251. package/src/_shims/fetch.node.js +0 -12
  252. package/src/_shims/fetch.node.mjs +0 -14
  253. package/src/_shims/fileFromPath.node.ts +0 -29
  254. package/src/_shims/fileFromPath.ts +0 -29
  255. package/src/_shims/formdata.d.ts +0 -43
  256. package/src/_shims/formdata.deno.ts +0 -16
  257. package/src/_shims/formdata.js +0 -17
  258. package/src/_shims/formdata.mjs +0 -20
  259. package/src/_shims/formdata.node.d.ts +0 -45
  260. package/src/_shims/formdata.node.js +0 -11
  261. package/src/_shims/formdata.node.mjs +0 -9
  262. package/src/_shims/getMultipartRequestOptions.node.ts +0 -25
  263. package/src/_shims/getMultipartRequestOptions.ts +0 -14
  264. package/src/_shims/node-readable.node.ts +0 -10
  265. package/src/_shims/node-readable.ts +0 -30
package/error.mjs CHANGED
@@ -1,116 +1,126 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
- import { castToError } from './core.mjs';
3
- export class APIError extends Error {
4
- constructor(status, error, message, headers) {
5
- super(APIError.makeMessage(error, message));
6
- this.status = status;
7
- this.headers = headers;
8
- this.error = error;
9
- }
10
- static makeMessage(error, message) {
11
- return (
12
- (
13
- error === null || error === void 0 ? void 0 : error.message
14
- ) ?
15
- typeof error.message === 'string' ? error.message
16
- : JSON.stringify(error.message)
17
- : error ? JSON.stringify(error)
18
- : message || 'Unknown error occurred'
19
- );
20
- }
21
- static generate(status, errorResponse, message, headers) {
22
- if (!status) {
23
- return new APIConnectionError({ cause: castToError(errorResponse) });
24
- }
25
- const error = errorResponse;
26
- if (status === 400) {
27
- return new BadRequestError(status, error, message, headers);
28
- }
29
- if (status === 401) {
30
- return new AuthenticationError(status, error, message, headers);
31
- }
32
- if (status === 403) {
33
- return new PermissionDeniedError(status, error, message, headers);
34
- }
35
- if (status === 404) {
36
- return new NotFoundError(status, error, message, headers);
37
- }
38
- if (status === 409) {
39
- return new ConflictError(status, error, message, headers);
40
- }
41
- if (status === 422) {
42
- return new UnprocessableEntityError(status, error, message, headers);
2
+ import { castToError } from "./core.mjs";
3
+ export class AnthropicError extends Error {
4
+ }
5
+ export class APIError extends AnthropicError {
6
+ constructor(status, error, message, headers) {
7
+ super(`${APIError.makeMessage(status, error, message)}`);
8
+ this.status = status;
9
+ this.headers = headers;
10
+ this.error = error;
43
11
  }
44
- if (status === 429) {
45
- return new RateLimitError(status, error, message, headers);
12
+ static makeMessage(status, error, message) {
13
+ const msg = error?.message ?
14
+ typeof error.message === 'string' ? error.message
15
+ : JSON.stringify(error.message)
16
+ : error ? JSON.stringify(error)
17
+ : message;
18
+ if (status && msg) {
19
+ return `${status} ${msg}`;
20
+ }
21
+ if (status) {
22
+ return `${status} status code (no body)`;
23
+ }
24
+ if (msg) {
25
+ return msg;
26
+ }
27
+ return '(no status code or body)';
46
28
  }
47
- if (status >= 500) {
48
- return new InternalServerError(status, error, message, headers);
29
+ static generate(status, errorResponse, message, headers) {
30
+ if (!status) {
31
+ return new APIConnectionError({ cause: castToError(errorResponse) });
32
+ }
33
+ const error = errorResponse;
34
+ if (status === 400) {
35
+ return new BadRequestError(status, error, message, headers);
36
+ }
37
+ if (status === 401) {
38
+ return new AuthenticationError(status, error, message, headers);
39
+ }
40
+ if (status === 403) {
41
+ return new PermissionDeniedError(status, error, message, headers);
42
+ }
43
+ if (status === 404) {
44
+ return new NotFoundError(status, error, message, headers);
45
+ }
46
+ if (status === 409) {
47
+ return new ConflictError(status, error, message, headers);
48
+ }
49
+ if (status === 422) {
50
+ return new UnprocessableEntityError(status, error, message, headers);
51
+ }
52
+ if (status === 429) {
53
+ return new RateLimitError(status, error, message, headers);
54
+ }
55
+ if (status >= 500) {
56
+ return new InternalServerError(status, error, message, headers);
57
+ }
58
+ return new APIError(status, error, message, headers);
49
59
  }
50
- return new APIError(status, error, message, headers);
51
- }
52
60
  }
53
61
  export class APIUserAbortError extends APIError {
54
- constructor({ message } = {}) {
55
- super(undefined, undefined, message || 'Request was aborted.', undefined);
56
- this.status = undefined;
57
- }
62
+ constructor({ message } = {}) {
63
+ super(undefined, undefined, message || 'Request was aborted.', undefined);
64
+ this.status = undefined;
65
+ }
58
66
  }
59
67
  export class APIConnectionError extends APIError {
60
- constructor({ message, cause }) {
61
- super(undefined, undefined, message || 'Connection error.', undefined);
62
- this.status = undefined;
63
- // in some environments the 'cause' property is already declared
64
- // @ts-ignore
65
- if (cause) this.cause = cause;
66
- }
68
+ constructor({ message, cause }) {
69
+ super(undefined, undefined, message || 'Connection error.', undefined);
70
+ this.status = undefined;
71
+ // in some environments the 'cause' property is already declared
72
+ // @ts-ignore
73
+ if (cause)
74
+ this.cause = cause;
75
+ }
67
76
  }
68
77
  export class APIConnectionTimeoutError extends APIConnectionError {
69
- constructor() {
70
- super({ message: 'Request timed out.' });
71
- }
78
+ constructor({ message } = {}) {
79
+ super({ message: message ?? 'Request timed out.' });
80
+ }
72
81
  }
73
82
  export class BadRequestError extends APIError {
74
- constructor() {
75
- super(...arguments);
76
- this.status = 400;
77
- }
83
+ constructor() {
84
+ super(...arguments);
85
+ this.status = 400;
86
+ }
78
87
  }
79
88
  export class AuthenticationError extends APIError {
80
- constructor() {
81
- super(...arguments);
82
- this.status = 401;
83
- }
89
+ constructor() {
90
+ super(...arguments);
91
+ this.status = 401;
92
+ }
84
93
  }
85
94
  export class PermissionDeniedError extends APIError {
86
- constructor() {
87
- super(...arguments);
88
- this.status = 403;
89
- }
95
+ constructor() {
96
+ super(...arguments);
97
+ this.status = 403;
98
+ }
90
99
  }
91
100
  export class NotFoundError extends APIError {
92
- constructor() {
93
- super(...arguments);
94
- this.status = 404;
95
- }
101
+ constructor() {
102
+ super(...arguments);
103
+ this.status = 404;
104
+ }
96
105
  }
97
106
  export class ConflictError extends APIError {
98
- constructor() {
99
- super(...arguments);
100
- this.status = 409;
101
- }
107
+ constructor() {
108
+ super(...arguments);
109
+ this.status = 409;
110
+ }
102
111
  }
103
112
  export class UnprocessableEntityError extends APIError {
104
- constructor() {
105
- super(...arguments);
106
- this.status = 422;
107
- }
113
+ constructor() {
114
+ super(...arguments);
115
+ this.status = 422;
116
+ }
108
117
  }
109
118
  export class RateLimitError extends APIError {
110
- constructor() {
111
- super(...arguments);
112
- this.status = 429;
113
- }
119
+ constructor() {
120
+ super(...arguments);
121
+ this.status = 429;
122
+ }
123
+ }
124
+ export class InternalServerError extends APIError {
114
125
  }
115
- export class InternalServerError extends APIError {}
116
- //# sourceMappingURL=error.mjs.map
126
+ //# sourceMappingURL=error.mjs.map
package/error.mjs.map CHANGED
@@ -1 +1 @@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IACtC,CAAC;CAAA;AAED,MAAM,OAAO,mBAAoB,SAAQ,QAAQ;CAAG"}
package/index.d.mts CHANGED
@@ -1,128 +1,121 @@
1
- import * as Core from './core.js';
2
- import * as API from './resources/index.js';
3
- import * as Errors from './error.js';
4
- import type { Agent } from '@anthropic-ai/sdk/_shims/agent';
5
- import * as Uploads from './uploads.js';
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
- * Defaults to process.env["ANTHROPIC_API_KEY"]. Set it to null if you want to send unauthenticated requests.
9
- */
10
- apiKey?: string | null;
11
- /**
12
- * Override the default base URL for the API, e.g., "https://api.example.com/v2/"
13
- */
14
- baseURL?: string;
15
- /**
16
- * The maximum amount of time (in milliseconds) that the client should wait for a response
17
- * from the server before timing out a single request.
18
- *
19
- * Note that request timeouts are retried by default, so in a worst-case scenario you may wait
20
- * much longer than this timeout before the promise succeeds or fails.
21
- */
22
- timeout?: number;
23
- /**
24
- * An HTTP agent used to manage HTTP(S) connections.
25
- *
26
- * If not provided, an agent will be constructed by default in the Node.js environment,
27
- * otherwise no agent is used.
28
- */
29
- httpAgent?: Agent;
30
- /**
31
- * Specify a custom `fetch` function implementation.
32
- *
33
- * If not provided, we use `node-fetch` on Node.js and otherwise expect that `fetch` is
34
- * defined globally.
35
- */
36
- fetch?: Core.Fetch | undefined;
37
- /**
38
- * The maximum number of times that the client will retry a request in case of a
39
- * temporary failure, like a network error or a 5XX error from the server.
40
- *
41
- * @default 2
42
- */
43
- maxRetries?: number;
44
- /**
45
- * Default headers to include with every request to the API.
46
- *
47
- * These can be removed in individual requests by explicitly setting the
48
- * header to `undefined` or `null` in request options.
49
- */
50
- defaultHeaders?: Core.Headers;
51
- /**
52
- * Default query parameters to include with every request to the API.
53
- *
54
- * These can be removed in individual requests by explicitly setting the
55
- * param to `undefined` in request options.
56
- */
57
- defaultQuery?: Core.DefaultQuery;
58
- authToken?: string | null;
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
- apiKey: string | null;
63
- authToken?: string | null;
64
- private _options;
65
- /**
66
- * API Client for interfacing with the Anthropic API.
67
- *
68
- * @param {string | null} [opts.apiKey=process.env['ANTHROPIC_API_KEY']] - The API Key to send to the API.
69
- * @param {string} [opts.baseURL] - Override the default base URL for the API.
70
- * @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
71
- * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
72
- * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
73
- * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
74
- * @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
75
- * @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
76
- * @param {string | null} [opts.authToken]
77
- */
78
- constructor({ apiKey, authToken, ...opts }?: ClientOptions);
79
- completions: API.Completions;
80
- protected defaultQuery(): Core.DefaultQuery | undefined;
81
- protected defaultHeaders(opts: Core.FinalRequestOptions): Core.Headers;
82
- protected validateHeaders(headers: Core.Headers, customHeaders: Core.Headers): void;
83
- protected authHeaders(opts: Core.FinalRequestOptions): Core.Headers;
84
- protected apiKeyHeader(opts: Core.FinalRequestOptions): Core.Headers;
85
- protected authTokenBearer(opts: Core.FinalRequestOptions): Core.Headers;
86
- static Anthropic: typeof Anthropic;
87
- static HUMAN_PROMPT: string;
88
- static AI_PROMPT: string;
89
- static APIError: typeof Errors.APIError;
90
- static APIConnectionError: typeof Errors.APIConnectionError;
91
- static APIConnectionTimeoutError: typeof Errors.APIConnectionTimeoutError;
92
- static APIUserAbortError: typeof Errors.APIUserAbortError;
93
- static NotFoundError: typeof Errors.NotFoundError;
94
- static ConflictError: typeof Errors.ConflictError;
95
- static RateLimitError: typeof Errors.RateLimitError;
96
- static BadRequestError: typeof Errors.BadRequestError;
97
- static AuthenticationError: typeof Errors.AuthenticationError;
98
- static InternalServerError: typeof Errors.InternalServerError;
99
- static PermissionDeniedError: typeof Errors.PermissionDeniedError;
100
- static UnprocessableEntityError: typeof Errors.UnprocessableEntityError;
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
- export import toFile = Uploads.toFile;
119
- export import fileFromPath = Uploads.fileFromPath;
120
- export import RequestOptions = Core.RequestOptions;
121
- export import Completions = API.Completions;
122
- export import Completion = API.Completion;
123
- export import CompletionCreateParams = API.CompletionCreateParams;
124
- export import CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
125
- export import CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
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