@@ -19,6 +19,7 @@ import type {
19
19
} from "@aws-sdk/client-bedrock-runtime" ;
20
20
import {
21
21
BedrockRuntimeClient ,
22
+ BedrockRuntimeClientConfig ,
22
23
ConverseCommand ,
23
24
ConverseStreamCommand ,
24
25
} from "@aws-sdk/client-bedrock-runtime" ;
@@ -71,6 +72,13 @@ export interface ChatBedrockConverseInput
71
72
*/
72
73
client ?: BedrockRuntimeClient ;
73
74
75
+ /**
76
+ * Overrideable configuration options for the BedrockRuntimeClient.
77
+ * Allows customization of client configuration such as requestHandler, etc.
78
+ * Will be ignored if 'client' is provided.
79
+ */
80
+ clientOptions ?: BedrockRuntimeClientConfig ;
81
+
74
82
/**
75
83
* Whether or not to stream responses
76
84
*/
@@ -244,6 +252,10 @@ export interface ChatBedrockConverseCallOptions
244
252
* secretAccessKey: process.env.BEDROCK_AWS_SECRET_ACCESS_KEY!,
245
253
* accessKeyId: process.env.BEDROCK_AWS_ACCESS_KEY_ID!,
246
254
* },
255
+ * // Configure client options (e.g., custom request handler)
256
+ * // clientOptions: {
257
+ * // requestHandler: myCustomRequestHandler,
258
+ * // },
247
259
* // other params...
248
260
* });
249
261
* ```
@@ -666,6 +678,8 @@ export class ChatBedrockConverse
666
678
667
679
client : BedrockRuntimeClient ;
668
680
681
+ clientOptions ?: BedrockRuntimeClientConfig ;
682
+
669
683
/**
670
684
* Which types of `tool_choice` values the model supports.
671
685
*
@@ -713,6 +727,7 @@ export class ChatBedrockConverse
713
727
this . client =
714
728
fields ?. client ??
715
729
new BedrockRuntimeClient ( {
730
+ ...fields ?. clientOptions ,
716
731
region,
717
732
credentials,
718
733
endpoint : rest . endpointHost
@@ -731,6 +746,7 @@ export class ChatBedrockConverse
731
746
this . streamUsage = rest ?. streamUsage ?? this . streamUsage ;
732
747
this . guardrailConfig = rest ?. guardrailConfig ;
733
748
this . performanceConfig = rest ?. performanceConfig ;
749
+ this . clientOptions = rest ?. clientOptions ;
734
750
735
751
if ( rest ?. supportsToolChoiceValues === undefined ) {
736
752
this . supportsToolChoiceValues = supportedToolChoiceValuesForModel (
0 commit comments