File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ def SingleStoreChatFactory(
111111 cfg = Config ()
112112 if http_client is not None and http_client .timeout is not None :
113113 cfg .timeout = http_client .timeout
114+ cfg .connect_timeout = http_client .timeout
114115 client = boto3 .client (
115116 'bedrock-runtime' ,
116117 endpoint_url = info .connection_url , # redirect requests to UMG
@@ -127,6 +128,10 @@ def _inject_headers(request: Any, **_ignored: Any) -> None:
127128 request .headers ['X-S2-OBO' ] = obo_val
128129 if token :
129130 request .headers ['Authorization' ] = f'Bearer { token } '
131+ if streaming :
132+ request .headers ['X-BEDROCK-CONVERSE-STREAMING' ] = 'true'
133+ else :
134+ request .headers ['X-BEDROCK-CONVERSE' ] = 'true'
130135
131136 emitter = client ._endpoint ._event_emitter
132137 emitter .register_first (
You can’t perform that action at this time.
0 commit comments