From e48cd57931cd0e81a77b55653cb1f663111dd733 Mon Sep 17 00:00:00 2001 From: Stainless Bot <107565488+stainless-bot@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:54:48 -0500 Subject: [PATCH] fix(types): accept undefined for optional client options (#635) --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index f72850cf9..417f52e38 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,12 +11,12 @@ export interface ClientOptions { /** * Defaults to process.env['OPENAI_API_KEY']. */ - apiKey?: string; + apiKey?: string | undefined; /** * Defaults to process.env['OPENAI_ORG_ID']. */ - organization?: string | null; + organization?: string | null | undefined; /** * Override the default base URL for the API, e.g., "https://api.example.com/v2/" @@ -91,8 +91,8 @@ export class OpenAI extends Core.APIClient { /** * API Client for interfacing with the OpenAI API. * - * @param {string} [opts.apiKey=process.env['OPENAI_API_KEY'] ?? undefined] - * @param {string | null} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null] + * @param {string | undefined} [opts.apiKey=process.env['OPENAI_API_KEY'] ?? undefined] + * @param {string | null | undefined} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null] * @param {string} [opts.baseURL=process.env['OPENAI_BASE_URL'] ?? https://api.openai.com/v1] - 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.