Skip to content

Commit

Permalink
feat(docs): add documentation to the client constructor (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored and RobertCraigie committed Aug 23, 2023
1 parent 0ade979 commit 79303f9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,26 @@ export interface ClientOptions {
authToken?: string | null;
}

/** Instantiate the API Client. */
/** API Client for interfacing with the Anthropic API. */
export class Anthropic extends Core.APIClient {
apiKey: string | null;
authToken?: string | null;

private _options: ClientOptions;

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

0 comments on commit 79303f9

Please sign in to comment.