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 authored Aug 24, 2024
1 parent 1ad8006 commit 953e261
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/requests/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ 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 953e261

Please sign in to comment.