File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,7 @@ export function convertHooksShorthand(
230
230
hooksObject . checks = Object . keys ( hook ) . map ( ( key ) => ( {
231
231
id : key . includes ( '.' ) ? key : `default.${ key } ` ,
232
232
parameters : hook [ key ] ,
233
+ is_enabled : hook [ key ] . is_enabled ,
233
234
} ) ) ;
234
235
235
236
return hooksObject ;
Original file line number Diff line number Diff line change @@ -196,22 +196,23 @@ const BedrockAPIConfig: BedrockAPIConfigInterface = {
196
196
return `/model-invocation-job/${ batchId } /stop` ;
197
197
}
198
198
const { model, stream } = gatewayRequestBody ;
199
+ const uriEncodedModel = encodeURIComponent ( decodeURIComponent ( model ?? '' ) ) ;
199
200
if ( ! model && ! BEDROCK_NO_MODEL_ENDPOINTS . includes ( fn as endpointStrings ) ) {
200
201
throw new GatewayError ( 'Model is required' ) ;
201
202
}
202
203
let mappedFn : string = fn ;
203
204
if ( stream ) {
204
205
mappedFn = `stream-${ fn } ` ;
205
206
}
206
- let endpoint = `/model/${ model } /invoke` ;
207
- let streamEndpoint = `/model/${ model } /invoke-with-response-stream` ;
207
+ let endpoint = `/model/${ uriEncodedModel } /invoke` ;
208
+ let streamEndpoint = `/model/${ uriEncodedModel } /invoke-with-response-stream` ;
208
209
if (
209
210
( mappedFn === 'chatComplete' || mappedFn === 'stream-chatComplete' ) &&
210
211
model &&
211
212
! bedrockInvokeModels . includes ( model )
212
213
) {
213
- endpoint = `/model/${ model } /converse` ;
214
- streamEndpoint = `/model/${ model } /converse-stream` ;
214
+ endpoint = `/model/${ uriEncodedModel } /converse` ;
215
+ streamEndpoint = `/model/${ uriEncodedModel } /converse-stream` ;
215
216
}
216
217
217
218
const jobIdIndex = fn === 'cancelFinetune' ? - 2 : - 1 ;
You can’t perform that action at this time.
0 commit comments