promptlayer 1.0.65__py3-none-any.whl → 1.0.67__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.67"
4
4
  __all__ = ["PromptLayer", "AsyncPromptLayer", "__version__"]
@@ -326,6 +326,7 @@ class PromptLayer(PromptLayerMixin):
326
326
  function_name: str = "",
327
327
  score: int = 0,
328
328
  prompt_id: Union[int, None] = None,
329
+ score_name: Union[str, None] = None,
329
330
  ):
330
331
  return util_log_request(
331
332
  self.api_key,
@@ -347,6 +348,7 @@ class PromptLayer(PromptLayerMixin):
347
348
  function_name=function_name,
348
349
  score=score,
349
350
  prompt_id=prompt_id,
351
+ score_name=score_name,
350
352
  )
351
353
 
352
354
 
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.67
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,7 +1,7 @@
1
- promptlayer/__init__.py,sha256=P1Cf4whOUCaydPccPLRuj9UmqbylJsnGjuDyiRa4l38,140
1
+ promptlayer/__init__.py,sha256=RzFSknxhW5-pfU0yRrfepqjQrkoYD3c45M8gIMpHxLE,140
2
2
  promptlayer/groups/__init__.py,sha256=xhOAolLUBkr76ZHvJr29OwjCIk1V9qKQXjZCuyTJUIY,429
3
3
  promptlayer/groups/groups.py,sha256=YPROicy-TzpkrpA8vOpZS2lwvJ6VRtlbQ1S2oT1N0vM,338
4
- promptlayer/promptlayer.py,sha256=GY4dEID1bsazlcft1ECuNx0tIFqX5dLxMMgsec8bXt8,22816
4
+ promptlayer/promptlayer.py,sha256=HOb6pxWBCooXyEuaPlhCqGYjwmzxixfW4HPwr2y5Yhw,22896
5
5
  promptlayer/promptlayer_base.py,sha256=jOgXzNZlV1LKOOsXSSAOgn8o4hXn_EV0oY9Nf3Bsu_s,6872
6
6
  promptlayer/promptlayer_mixins.py,sha256=xgDwpr8D4Hl_n0OidlzeEWZtHfrhRQDIDx6a_z5Iy48,13930
7
7
  promptlayer/span_exporter.py,sha256=Pc1-zWAcjVCSykh-4rYPqiEZvzkG9xaYLVoHFY_TWaQ,2410
@@ -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.67.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
20
+ promptlayer-1.0.67.dist-info/METADATA,sha256=UfliH2klLgyPbRpwHoMUgcvyR7D_Y3yqGLiLPaCb5KI,4819
21
+ promptlayer-1.0.67.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
22
+ promptlayer-1.0.67.dist-info/RECORD,,