mirascope 1.21.2__py3-none-any.whl → 1.21.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mirascope/core/bedrock/_utils/_setup_call.py +14 -2
- {mirascope-1.21.2.dist-info → mirascope-1.21.3.dist-info}/METADATA +1 -1
- {mirascope-1.21.2.dist-info → mirascope-1.21.3.dist-info}/RECORD +5 -5
- {mirascope-1.21.2.dist-info → mirascope-1.21.3.dist-info}/WHEEL +0 -0
- {mirascope-1.21.2.dist-info → mirascope-1.21.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import os
|
|
5
6
|
from collections.abc import AsyncGenerator, Awaitable, Callable, Coroutine, Generator
|
|
6
7
|
from functools import wraps
|
|
7
8
|
from typing import Any, ParamSpec, cast, overload
|
|
@@ -223,12 +224,23 @@ def setup_call(
|
|
|
223
224
|
|
|
224
225
|
call_kwargs |= cast(BedrockCallKwargs, {"modelId": model, "messages": messages})
|
|
225
226
|
|
|
227
|
+
env_vars = {}
|
|
228
|
+
if access_key_id := os.getenv("AWS_ACCESS_KEY_ID"):
|
|
229
|
+
env_vars["aws_access_key_id"] = access_key_id
|
|
230
|
+
if secret_access_key := os.getenv("AWS_SECRET_ACCESS_KEY"):
|
|
231
|
+
env_vars["aws_secret_access_key"] = secret_access_key
|
|
232
|
+
if session_token := os.getenv("AWS_SESSION_TOKEN"):
|
|
233
|
+
env_vars["aws_session_token"] = session_token
|
|
234
|
+
if region_name := os.getenv("AWS_REGION_NAME"):
|
|
235
|
+
env_vars["region_name"] = region_name
|
|
236
|
+
if profile_name := os.getenv("AWS_PROFILE"):
|
|
237
|
+
env_vars["profile_name"] = profile_name
|
|
226
238
|
if client is None:
|
|
227
239
|
if fn_is_async(fn):
|
|
228
|
-
session = get_session()
|
|
240
|
+
session = get_session(env_vars=env_vars)
|
|
229
241
|
_client = _AsyncBedrockRuntimeWrappedClient(session, model)
|
|
230
242
|
else:
|
|
231
|
-
session = Session()
|
|
243
|
+
session = Session(**env_vars)
|
|
232
244
|
_client = session.client("bedrock-runtime")
|
|
233
245
|
else:
|
|
234
246
|
_client = client
|
|
@@ -158,7 +158,7 @@ mirascope/core/bedrock/_utils/_convert_message_params.py,sha256=ZPFj34ed0-4bmMld
|
|
|
158
158
|
mirascope/core/bedrock/_utils/_get_json_output.py,sha256=hW-IBBQ5YW85VljjFJHDDtu66zsaF2ydTbFxgCX_j6A,1159
|
|
159
159
|
mirascope/core/bedrock/_utils/_handle_stream.py,sha256=s8KNMNDKzvSIkFROtaZgbEJry78X_qCzTvGmHcL7UW0,3776
|
|
160
160
|
mirascope/core/bedrock/_utils/_message_param_converter.py,sha256=T45kksn78idbqD9NZ3Omx1nS_IoYmTfA5y-bAHlX2fM,6846
|
|
161
|
-
mirascope/core/bedrock/_utils/_setup_call.py,sha256=
|
|
161
|
+
mirascope/core/bedrock/_utils/_setup_call.py,sha256=XQs-JlviE0uhbBxEpjXP8812NbiObLYx5VkAwJJAF84,9168
|
|
162
162
|
mirascope/core/cohere/__init__.py,sha256=vk73WFGBOEmMFEiqWMRnPfxsCBDlDcq8SaLB2A6RKeo,830
|
|
163
163
|
mirascope/core/cohere/_call.py,sha256=y0nB_7h7FWCNxHRPywtAVCYXyeYX3uzTyYBPWnuLwUE,2261
|
|
164
164
|
mirascope/core/cohere/_call_kwargs.py,sha256=YmHwiofs0QADGp0wXUtOr_Z5Pt849zaCtIZmVyjw2OM,292
|
|
@@ -368,7 +368,7 @@ mirascope/v0/base/ops_utils.py,sha256=1Qq-VIwgHBaYutiZsS2MUQ4OgPC3APyywI5bTiTAmA
|
|
|
368
368
|
mirascope/v0/base/prompts.py,sha256=FM2Yz98cSnDceYogiwPrp4BALf3_F3d4fIOCGAkd-SE,1298
|
|
369
369
|
mirascope/v0/base/types.py,sha256=ZfatJoX0Yl0e3jhv0D_MhiSVHLYUeJsdN3um3iE10zY,352
|
|
370
370
|
mirascope/v0/base/utils.py,sha256=XREPENRQTu8gpMhHU8RC8qH_am3FfGUvY-dJ6x8i-mw,681
|
|
371
|
-
mirascope-1.21.
|
|
372
|
-
mirascope-1.21.
|
|
373
|
-
mirascope-1.21.
|
|
374
|
-
mirascope-1.21.
|
|
371
|
+
mirascope-1.21.3.dist-info/METADATA,sha256=C4EyG1JBa6VMuS-WqgsCGClL3eLVtBN0dPzL1nJ6Rsg,8730
|
|
372
|
+
mirascope-1.21.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
373
|
+
mirascope-1.21.3.dist-info/licenses/LICENSE,sha256=LAs5Q8mdawTsVdONpDGukwsoc4KEUBmmonDEL39b23Y,1072
|
|
374
|
+
mirascope-1.21.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|