Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e48cd57

Browse files
authoredJan 17, 2024
fix(types): accept undefined for optional client options (#635)
1 parent fd64971 commit e48cd57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ export interface ClientOptions {
1111
/**
1212
* Defaults to process.env['OPENAI_API_KEY'].
1313
*/
14-
apiKey?: string;
14+
apiKey?: string | undefined;
1515

1616
/**
1717
* Defaults to process.env['OPENAI_ORG_ID'].
1818
*/
19-
organization?: string | null;
19+
organization?: string | null | undefined;
2020

2121
/**
2222
* 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 {
9191
/**
9292
* API Client for interfacing with the OpenAI API.
9393
*
94-
* @param {string} [opts.apiKey=process.env['OPENAI_API_KEY'] ?? undefined]
95-
* @param {string | null} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null]
94+
* @param {string | undefined} [opts.apiKey=process.env['OPENAI_API_KEY'] ?? undefined]
95+
* @param {string | null | undefined} [opts.organization=process.env['OPENAI_ORG_ID'] ?? null]
9696
* @param {string} [opts.baseURL=process.env['OPENAI_BASE_URL'] ?? https://api.openai.com/v1] - Override the default base URL for the API.
9797
* @param {number} [opts.timeout=10 minutes] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
9898
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.

0 commit comments

Comments
 (0)
Please sign in to comment.