promptlayer 1.0.65__py3-none-any.whl → 1.0.66__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.

Potentially problematic release.


This version of promptlayer might be problematic. Click here for more details.

promptlayer/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
1
  from .promptlayer import AsyncPromptLayer, PromptLayer
2
2
 
3
- __version__ = "1.0.65"
3
+ __version__ = "1.0.66"
4
4
  __all__ = ["PromptLayer", "AsyncPromptLayer", "__version__"]
promptlayer/utils.py CHANGED
@@ -1455,7 +1455,14 @@ MAP_TYPE_TO_GOOGLE_FUNCTION = {
1455
1455
  def google_request(prompt_blueprint: GetPromptTemplateResponse, client_kwargs: dict, function_kwargs: dict):
1456
1456
  from google import genai
1457
1457
 
1458
- client = genai.Client()
1458
+ if os.environ.get("GOOGLE_GENAI_USE_VERTEXAI") == "true":
1459
+ client = genai.Client(
1460
+ vertexai=True,
1461
+ project=os.environ.get("GOOGLE_CLOUD_PROJECT"),
1462
+ location=os.environ.get("GOOGLE_CLOUD_LOCATION"),
1463
+ )
1464
+ else:
1465
+ client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY") or os.environ.get("GOOGLE_API_KEY"))
1459
1466
  request_to_make = MAP_TYPE_TO_GOOGLE_FUNCTION[prompt_blueprint["prompt_template"]["type"]]
1460
1467
  return request_to_make(client, **function_kwargs)
1461
1468
 
@@ -1493,7 +1500,14 @@ AMAP_TYPE_TO_GOOGLE_FUNCTION = {
1493
1500
  async def agoogle_request(prompt_blueprint: GetPromptTemplateResponse, client_kwargs: dict, function_kwargs: dict):
1494
1501
  from google import genai
1495
1502
 
1496
- client = genai.Client()
1503
+ if os.environ.get("GOOGLE_GENAI_USE_VERTEXAI") == "true":
1504
+ client = genai.Client(
1505
+ vertexai=True,
1506
+ project=os.environ.get("GOOGLE_CLOUD_PROJECT"),
1507
+ location=os.environ.get("GOOGLE_CLOUD_LOCATION"),
1508
+ )
1509
+ else:
1510
+ client = genai.Client(api_key=os.environ.get("GEMINI_API_KEY") or os.environ.get("GOOGLE_API_KEY"))
1497
1511
  request_to_make = AMAP_TYPE_TO_GOOGLE_FUNCTION[prompt_blueprint["prompt_template"]["type"]]
1498
1512
  return await request_to_make(client, **function_kwargs)
1499
1513
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: promptlayer
3
- Version: 1.0.65
3
+ Version: 1.0.66
4
4
  Summary: PromptLayer is a platform for prompt engineering and tracks your LLM requests.
5
5
  License: Apache-2.0
6
6
  Author: Magniv
@@ -1,4 +1,4 @@
1
- promptlayer/__init__.py,sha256=P1Cf4whOUCaydPccPLRuj9UmqbylJsnGjuDyiRa4l38,140
1
+ promptlayer/__init__.py,sha256=JCUkBlTtZzf0gJZbfAHmsMnKWnGC80RlnOYnyvbATu8,140
2
2
  promptlayer/groups/__init__.py,sha256=xhOAolLUBkr76ZHvJr29OwjCIk1V9qKQXjZCuyTJUIY,429
3
3
  promptlayer/groups/groups.py,sha256=YPROicy-TzpkrpA8vOpZS2lwvJ6VRtlbQ1S2oT1N0vM,338
4
4
  promptlayer/promptlayer.py,sha256=GY4dEID1bsazlcft1ECuNx0tIFqX5dLxMMgsec8bXt8,22816
@@ -15,8 +15,8 @@ promptlayer/track/track.py,sha256=A-awcYwsSwxktrlCMchy8NITIquwxU1UXbgLZMwqrA0,31
15
15
  promptlayer/types/__init__.py,sha256=xJcvQuOk91ZBBePb40-1FDNDKYrZoH5lPE2q6_UhprM,111
16
16
  promptlayer/types/prompt_template.py,sha256=blkVBhh4u5pMhgX_Dsn78sN7Rv2Vy_zhd1-NERLXTpM,5075
17
17
  promptlayer/types/request_log.py,sha256=xU6bcxQar6GaBOJlgZTavXUV3FjE8sF_nSjPu4Ya_00,174
18
- promptlayer/utils.py,sha256=FzW_mTr0nyPDHoYG9XBCUE6Ch04ga4qxmEfwUNAZfpo,59585
19
- promptlayer-1.0.65.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
20
- promptlayer-1.0.65.dist-info/METADATA,sha256=BlyHiHS5AYa-1tHL-R1aIgSfiUJcaXdaohE4OIccFqE,4819
21
- promptlayer-1.0.65.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
22
- promptlayer-1.0.65.dist-info/RECORD,,
18
+ promptlayer/utils.py,sha256=RAiYZPWai6BOmlXTdxF4o3m9NhfZf--bHo7_Qc9X7eo,60269
19
+ promptlayer-1.0.66.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
20
+ promptlayer-1.0.66.dist-info/METADATA,sha256=417J9qK75CyEAjwqK15QgRe9cIEcEcnfazepKoMGtBU,4819
21
+ promptlayer-1.0.66.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
22
+ promptlayer-1.0.66.dist-info/RECORD,,