File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -86,21 +86,12 @@ export class AnthropicVertex extends BaseAnthropic {
8686 ) ;
8787 }
8888
89- if ( ! baseURL ) {
90- switch ( region ) {
91- case 'global' :
92- baseURL = 'https://aiplatform.googleapis.com/v1' ;
93- break ;
94- case 'us' :
95- baseURL = 'https://aiplatform.us.rep.googleapis.com/v1' ;
96- break ;
97- default :
98- baseURL = `https://${ region } -aiplatform.googleapis.com/v1` ;
99- }
100- }
101-
10289 super ( {
103- baseURL,
90+ baseURL :
91+ baseURL ||
92+ ( region === 'global' ?
93+ 'https://aiplatform.googleapis.com/v1'
94+ : `https://${ region } -aiplatform.googleapis.com/v1` ) ,
10495 ...opts ,
10596 } ) ;
10697
Original file line number Diff line number Diff line change @@ -25,15 +25,6 @@ describe('AnthropicVertex', () => {
2525 expect ( client . baseURL ) . toBe ( 'https://aiplatform.googleapis.com/v1' ) ;
2626 } ) ;
2727
28- test ( 'us region uses correct base URL' , ( ) => {
29- const client = new AnthropicVertex ( {
30- region : 'us' ,
31- projectId : 'test-project' ,
32- accessToken : 'fake-token' ,
33- } ) ;
34- expect ( client . baseURL ) . toBe ( 'https://aiplatform.us.rep.googleapis.com/v1' ) ;
35- } ) ;
36-
3728 test . each ( [ 'us-central1' , 'europe-west1' , 'asia-southeast1' ] ) (
3829 'regional endpoint %s uses correct base URL format' ,
3930 ( region ) => {
You can’t perform that action at this time.
0 commit comments