Skip to content

Commit 5730bcd

Browse files
Remove commented out code; set max retries to 1 for Amazon Bedrock models.
1 parent 307bcd5 commit 5730bcd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

singlestoredb/ai/chat.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,13 @@ def SingleStoreChatFactory(
109109

110110
if prefix == 'aura-amz':
111111
# Instantiate Bedrock client
112-
cfg = Config(signature_version=UNSIGNED)
112+
cfg = Config(
113+
signature_version=UNSIGNED,
114+
retries={
115+
'max_attempts': 1,
116+
'mode': 'standard',
117+
},
118+
)
113119
if http_client is not None and http_client.timeout is not None:
114120
cfg.timeout = http_client.timeout
115121
cfg.connect_timeout = http_client.timeout
@@ -129,14 +135,8 @@ def _inject_headers(request: Any, **_ignored: Any) -> None:
129135
request.headers['X-S2-OBO'] = obo_val
130136
if token:
131137
request.headers['Authorization'] = f'Bearer {token}'
132-
# if streaming:
133-
# request.headers['X-BEDROCK-CONVERSE-STREAMING'] = 'true'
134-
# else:
135-
# request.headers['X-BEDROCK-CONVERSE'] = 'true'
136138
request.headers.pop('X-Amz-Date', None)
137139
request.headers.pop('X-Amz-Security-Token', None)
138-
# request.headers.pop('Amz-Sdk-Request', None)
139-
# request.headers.pop('Amz-Sdk-Invocation-Id', None)
140140

141141
emitter = client._endpoint._event_emitter
142142
emitter.register_first(

0 commit comments

Comments
 (0)