Skip to content

Commit 79303f9

Browse files
stainless-botRobertCraigie
authored andcommitted
feat(docs): add documentation to the client constructor (#118)
1 parent 0ade979 commit 79303f9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/index.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,26 @@ export interface ClientOptions {
6969
authToken?: string | null;
7070
}
7171

72-
/** Instantiate the API Client. */
72+
/** API Client for interfacing with the Anthropic API. */
7373
export class Anthropic extends Core.APIClient {
7474
apiKey: string | null;
7575
authToken?: string | null;
7676

7777
private _options: ClientOptions;
7878

79+
/**
80+
* API Client for interfacing with the Anthropic API.
81+
*
82+
* @param {string | null} [opts.apiKey=process.env['ANTHROPIC_API_KEY']] - The API Key to send to the API.
83+
* @param {string} [opts.baseURL] - Override the default base URL for the API.
84+
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
85+
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
86+
* @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
87+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
88+
* @param {Core.Headers} opts.defaultHeaders - Default headers to include with every request to the API.
89+
* @param {Core.DefaultQuery} opts.defaultQuery - Default query parameters to include with every request to the API.
90+
* @param {string | null} [opts.authToken]
91+
*/
7992
constructor({
8093
apiKey = Core.readEnv('ANTHROPIC_API_KEY') ?? null,
8194
authToken = Core.readEnv('ANTHROPIC_AUTH_TOKEN') ?? null,

0 commit comments

Comments
 (0)