File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ export const VERTEX_TYPE = 'vertexAI';
2121
2222export const DEFAULT_LOCATION = 'us-central1' ;
2323
24- export const DEFAULT_BASE_URL = 'https://firebasevertexai .googleapis.com' ;
24+ export const DEFAULT_BASE_URL = 'staging-aiplatform.sandbox .googleapis.com' ;
2525
26- export const DEFAULT_API_VERSION = 'v1beta ' ;
26+ export const DEFAULT_API_VERSION = 'v1beta1 ' ;
2727
2828export const PACKAGE_VERSION = version ;
2929
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export class RequestUrl {
4545 // TODO: allow user-set option if that feature becomes available
4646 const apiVersion = DEFAULT_API_VERSION ;
4747 const baseUrl = this . requestOptions ?. baseUrl || DEFAULT_BASE_URL ;
48- let url = `${ baseUrl } /${ apiVersion } ` ;
48+ let url = `https:// ${ this . apiSettings . location } - ${ baseUrl } /${ apiVersion } ` ;
4949 url += `/projects/${ this . apiSettings . project } ` ;
5050 url += `/locations/${ this . apiSettings . location } ` ;
5151 url += `/${ this . model } ` ;
@@ -95,11 +95,11 @@ export async function getHeaders(url: RequestUrl): Promise<Headers> {
9595 }
9696 }
9797
98- if ( url . apiSettings . getAuthToken ) {
99- const authToken = await url . apiSettings . getAuthToken ( ) ;
100- if ( authToken ) {
101- headers . append ( 'Authorization' , `Firebase ${ authToken . accessToken } ` ) ;
102- }
98+ const GCLOUD_ACCESS_TOKEN = process . env . GCLOUD_ACCESS_TOKEN ;
99+ if ( GCLOUD_ACCESS_TOKEN ) {
100+ headers . append ( 'Authorization' , `Bearer ${ GCLOUD_ACCESS_TOKEN } ` ) ;
101+ } else {
102+ throw Error ( "Environment variable GCLOUD_ACCESS_TOKEN is undefined." ) ;
103103 }
104104
105105 return headers ;
You can’t perform that action at this time.
0 commit comments