Skip to content

Commit 65c5624

Browse files
committed
fix: Default params
1 parent 3b3398a commit 65c5624

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export class AI21 extends Core.APIClient {
1010
private _options: AI21Options;
1111

1212
constructor(
13-
apiKey: string = process.env.AI21_API_KEY || '',
14-
baseURL: string = process.env.AI21_BASE_URL || 'https://api.ai21.com/studio/v1',
15-
via: string | null,
13+
apiKey: string = process.env.AI21_API_KEY ?? '',
14+
baseURL: string = process.env.AI21_BASE_URL ?? 'https://api.ai21.com/studio/v1',
15+
via: string | null = null,
1616
) {
1717
const options: AI21Options = {
1818
apiKey,
@@ -26,7 +26,7 @@ export class AI21 extends Core.APIClient {
2626
apiKey,
2727
options: {}
2828
});
29-
29+
this.apiKey = apiKey
3030
this._options = options;
3131
}
3232

@@ -45,7 +45,7 @@ export class AI21 extends Core.APIClient {
4545

4646
protected override getUserAgent(): string {
4747
let userAgent = super.getUserAgent();
48-
48+
4949
if (this._options.via) {
5050
userAgent += ` via ${this._options.via}`;
5151
}

0 commit comments

Comments
 (0)