@@ -143,8 +143,7 @@ Evaluate the consistency and provide your score and reasoning in JSON format.`
143143 const providerId = getProviderFromModel ( model )
144144
145145 // Resolve Vertex AI OAuth credential to access token if needed
146- let resolvedApiKey = apiKey
147- const resolvedCredentials = { ...providerCredentials }
146+ let finalApiKey = apiKey
148147 if ( providerId === 'vertex' && providerCredentials ?. vertexCredential ) {
149148 const credential = await db . query . account . findFirst ( {
150149 where : eq ( account . id , providerCredentials . vertexCredential ) ,
@@ -156,10 +155,9 @@ Evaluate the consistency and provide your score and reasoning in JSON format.`
156155 providerCredentials . vertexCredential
157156 )
158157 if ( accessToken ) {
159- resolvedApiKey = accessToken
158+ finalApiKey = accessToken
160159 }
161160 }
162- resolvedCredentials . vertexCredential = undefined
163161 }
164162
165163 const response = await executeProviderRequest ( providerId , {
@@ -172,8 +170,14 @@ Evaluate the consistency and provide your score and reasoning in JSON format.`
172170 } ,
173171 ] ,
174172 temperature : 0.1 , // Low temperature for consistent scoring
175- apiKey : resolvedApiKey ,
176- ...resolvedCredentials ,
173+ apiKey : finalApiKey ,
174+ azureEndpoint : providerCredentials ?. azureEndpoint ,
175+ azureApiVersion : providerCredentials ?. azureApiVersion ,
176+ vertexProject : providerCredentials ?. vertexProject ,
177+ vertexLocation : providerCredentials ?. vertexLocation ,
178+ bedrockAccessKeyId : providerCredentials ?. bedrockAccessKeyId ,
179+ bedrockSecretKey : providerCredentials ?. bedrockSecretKey ,
180+ bedrockRegion : providerCredentials ?. bedrockRegion ,
177181 } )
178182
179183 if ( response instanceof ReadableStream || ( 'stream' in response && 'execution' in response ) ) {
0 commit comments