Skip to content

Commit f08fe92

Browse files
authored
Merge branch 'main' into panw-prisma-airs-plugin
2 parents 8cc47e5 + b20b030 commit f08fe92

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/handlers/handlerUtils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ export function convertHooksShorthand(
230230
hooksObject.checks = Object.keys(hook).map((key) => ({
231231
id: key.includes('.') ? key : `default.${key}`,
232232
parameters: hook[key],
233+
is_enabled: hook[key].is_enabled,
233234
}));
234235

235236
return hooksObject;

src/providers/bedrock/api.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,22 +196,23 @@ const BedrockAPIConfig: BedrockAPIConfigInterface = {
196196
return `/model-invocation-job/${batchId}/stop`;
197197
}
198198
const { model, stream } = gatewayRequestBody;
199+
const uriEncodedModel = encodeURIComponent(decodeURIComponent(model ?? ''));
199200
if (!model && !BEDROCK_NO_MODEL_ENDPOINTS.includes(fn as endpointStrings)) {
200201
throw new GatewayError('Model is required');
201202
}
202203
let mappedFn: string = fn;
203204
if (stream) {
204205
mappedFn = `stream-${fn}`;
205206
}
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`;
208209
if (
209210
(mappedFn === 'chatComplete' || mappedFn === 'stream-chatComplete') &&
210211
model &&
211212
!bedrockInvokeModels.includes(model)
212213
) {
213-
endpoint = `/model/${model}/converse`;
214-
streamEndpoint = `/model/${model}/converse-stream`;
214+
endpoint = `/model/${uriEncodedModel}/converse`;
215+
streamEndpoint = `/model/${uriEncodedModel}/converse-stream`;
215216
}
216217

217218
const jobIdIndex = fn === 'cancelFinetune' ? -2 : -1;

0 commit comments

Comments
 (0)