@@ -96,26 +96,17 @@ export class RouterBlockHandler implements BlockHandler {
9696 context : JSON . stringify ( messages ) ,
9797 temperature : ROUTER . INFERENCE_TEMPERATURE ,
9898 apiKey : finalApiKey ,
99+ azureEndpoint : inputs . azureEndpoint ,
100+ azureApiVersion : inputs . azureApiVersion ,
101+ vertexProject : routerConfig . vertexProject ,
102+ vertexLocation : routerConfig . vertexLocation ,
103+ bedrockAccessKeyId : routerConfig . bedrockAccessKeyId ,
104+ bedrockSecretKey : routerConfig . bedrockSecretKey ,
105+ bedrockRegion : routerConfig . bedrockRegion ,
99106 workflowId : ctx . workflowId ,
100107 workspaceId : ctx . workspaceId ,
101108 }
102109
103- if ( providerId === 'vertex' ) {
104- providerRequest . vertexProject = routerConfig . vertexProject
105- providerRequest . vertexLocation = routerConfig . vertexLocation
106- }
107-
108- if ( providerId === 'azure-openai' ) {
109- providerRequest . azureEndpoint = inputs . azureEndpoint
110- providerRequest . azureApiVersion = inputs . azureApiVersion
111- }
112-
113- if ( providerId === 'bedrock' ) {
114- providerRequest . bedrockAccessKeyId = routerConfig . bedrockAccessKeyId
115- providerRequest . bedrockSecretKey = routerConfig . bedrockSecretKey
116- providerRequest . bedrockRegion = routerConfig . bedrockRegion
117- }
118-
119110 const response = await fetch ( url . toString ( ) , {
120111 method : 'POST' ,
121112 headers : await buildAuthHeaders ( ) ,
@@ -234,6 +225,13 @@ export class RouterBlockHandler implements BlockHandler {
234225 context : JSON . stringify ( messages ) ,
235226 temperature : ROUTER . INFERENCE_TEMPERATURE ,
236227 apiKey : finalApiKey ,
228+ azureEndpoint : inputs . azureEndpoint ,
229+ azureApiVersion : inputs . azureApiVersion ,
230+ vertexProject : routerConfig . vertexProject ,
231+ vertexLocation : routerConfig . vertexLocation ,
232+ bedrockAccessKeyId : routerConfig . bedrockAccessKeyId ,
233+ bedrockSecretKey : routerConfig . bedrockSecretKey ,
234+ bedrockRegion : routerConfig . bedrockRegion ,
237235 workflowId : ctx . workflowId ,
238236 workspaceId : ctx . workspaceId ,
239237 responseFormat : {
@@ -257,22 +255,6 @@ export class RouterBlockHandler implements BlockHandler {
257255 } ,
258256 }
259257
260- if ( providerId === 'vertex' ) {
261- providerRequest . vertexProject = routerConfig . vertexProject
262- providerRequest . vertexLocation = routerConfig . vertexLocation
263- }
264-
265- if ( providerId === 'azure-openai' ) {
266- providerRequest . azureEndpoint = inputs . azureEndpoint
267- providerRequest . azureApiVersion = inputs . azureApiVersion
268- }
269-
270- if ( providerId === 'bedrock' ) {
271- providerRequest . bedrockAccessKeyId = routerConfig . bedrockAccessKeyId
272- providerRequest . bedrockSecretKey = routerConfig . bedrockSecretKey
273- providerRequest . bedrockRegion = routerConfig . bedrockRegion
274- }
275-
276258 const response = await fetch ( url . toString ( ) , {
277259 method : 'POST' ,
278260 headers : await buildAuthHeaders ( ) ,
0 commit comments