@@ -34,27 +34,29 @@ export class AnthropicVertexHandler extends BaseProvider implements SingleComple
3434 const projectId = this . options . vertexProjectId ?? "not-provided"
3535 const region = this . options . vertexRegion ?? "us-east5"
3636
37- if ( this . options . vertexJsonCredentials ) {
38- this . client = new AnthropicVertex ( {
39- projectId,
40- region,
41- googleAuth : new GoogleAuth ( {
42- scopes : [ "https://www.googleapis.com/auth/cloud-platform" ] ,
43- credentials : safeJsonParse < JWTInput > ( this . options . vertexJsonCredentials , undefined ) ,
44- } ) ,
45- } )
46- } else if ( this . options . vertexKeyFile ) {
47- this . client = new AnthropicVertex ( {
48- projectId,
49- region,
50- googleAuth : new GoogleAuth ( {
51- scopes : [ "https://www.googleapis.com/auth/cloud-platform" ] ,
52- keyFile : this . options . vertexKeyFile ,
53- } ) ,
54- } )
55- } else {
56- this . client = new AnthropicVertex ( { projectId, region } )
57- }
37+ //kilocode_change start
38+ // Manually construct the baseURL because the format has changed (there are no longer
39+ // dedicated hosts), but the required updated Anthropic libraries have significant
40+ // breaking changes for other parts of the application.
41+ const updatedBaseUrl = `https://aiplatform.googleapis.com/v1`
42+
43+ const googleAuthConfig =
44+ this . options . vertexJsonCredentials || this . options . vertexKeyFile
45+ ? {
46+ scopes : [ "https://www.googleapis.com/auth/cloud-platform" ] ,
47+ ...( this . options . vertexJsonCredentials
48+ ? { credentials : safeJsonParse < JWTInput > ( this . options . vertexJsonCredentials , undefined ) }
49+ : { keyFile : this . options . vertexKeyFile } ) ,
50+ }
51+ : undefined
52+
53+ this . client = new AnthropicVertex ( {
54+ baseURL : updatedBaseUrl ,
55+ projectId,
56+ region,
57+ ...( googleAuthConfig && { googleAuth : new GoogleAuth ( googleAuthConfig ) } ) ,
58+ } )
59+ //kilocode_change end
5860 }
5961
6062 override async * createMessage (
0 commit comments