From fa163d7954da928a21329844b2ffb6587c2d0c7c Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 16 Aug 2023 16:23:51 +0100 Subject: [PATCH] feat(docs): add documentation to the client constructor (#118) --- src/index.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index b12c504d..b435ce52 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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,