Skip to content

Commit 3c9a894

Browse files
author
awstools
committed
feat(client-bedrock-runtime): This release adds native h2 support for the bedrock runtime API, the support is only limited to SDKs that support h2 requests natively.
1 parent d01fbaa commit 3c9a894

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

clients/client-bedrock-runtime/src/runtimeConfig.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-node";
1616
import { Hash } from "@smithy/hash-node";
1717
import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
1818
import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
19-
import { NodeHttpHandler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
19+
import { NodeHttp2Handler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
2020
import { calculateBodyLength } from "@smithy/util-body-length-node";
2121
import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
2222
import { BedrockRuntimeClientConfig } from "./BedrockRuntimeClient";
@@ -51,7 +51,9 @@ export const getRuntimeConfig = (config: BedrockRuntimeClientConfig) => {
5151
region:
5252
config?.region ??
5353
loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...profileConfig }),
54-
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
54+
requestHandler: RequestHandler.create(
55+
config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true }))
56+
),
5557
retryMode:
5658
config?.retryMode ??
5759
loadNodeConfig(

codegen/sdk-codegen/aws-models/bedrock-runtime.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@
6060
"aws.auth#sigv4": {
6161
"name": "bedrock"
6262
},
63-
"aws.protocols#restJson1": {},
63+
"aws.protocols#restJson1": {
64+
"http": ["h2", "http/1.1"],
65+
"eventStreamHttp": ["h2", "http/1.1"]
66+
},
6467
"smithy.api#documentation": "<p>Describes the API operations for running inference using Amazon Bedrock models.</p>",
6568
"smithy.api#title": "Amazon Bedrock Runtime",
6669
"smithy.rules#endpointRuleSet": {

0 commit comments

Comments
 (0)