Skip to content

Commit

Permalink
Fixed RequestUrl, it now adds API Key to the URL
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert-Gao committed Aug 27, 2024
1 parent 1ad8006 commit e474c4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/requests/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ export class RequestUrl {
toString(): string {
const apiVersion = this.requestOptions?.apiVersion || DEFAULT_API_VERSION;
const baseUrl = this.requestOptions?.baseUrl || DEFAULT_BASE_URL;
let url = `${baseUrl}/${apiVersion}/${this.model}:${this.task}`;
let url = `${baseUrl}/${apiVersion}/${this.model}:${this.task}?key=${this.apiKey}`;

if (this.stream) {
url += "?alt=sse";
url += "&alt=sse";
}

return url;
}
}
Expand Down

0 comments on commit e474c4f

Please sign in to comment.