promptlayer 1.0.65__tar.gz → 1.0.67__tar.gz

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.

Files changed (22) hide show
  1. {promptlayer-1.0.65 → promptlayer-1.0.67}/PKG-INFO +1 -1
  2. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/__init__.py +1 -1
  3. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/promptlayer.py +2 -0
  4. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/utils.py +16 -2
  5. {promptlayer-1.0.65 → promptlayer-1.0.67}/pyproject.toml +1 -1
  6. {promptlayer-1.0.65 → promptlayer-1.0.67}/LICENSE +0 -0
  7. {promptlayer-1.0.65 → promptlayer-1.0.67}/README.md +0 -0
  8. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/groups/__init__.py +0 -0
  9. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/groups/groups.py +0 -0
  10. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/promptlayer_base.py +0 -0
  11. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/promptlayer_mixins.py +0 -0
  12. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/span_exporter.py +0 -0
  13. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/streaming/__init__.py +0 -0
  14. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/streaming/blueprint_builder.py +0 -0
  15. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/streaming/response_handlers.py +0 -0
  16. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/streaming/stream_processor.py +0 -0
  17. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/templates.py +0 -0
  18. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/track/__init__.py +0 -0
  19. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/track/track.py +0 -0
  20. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/types/__init__.py +0 -0
  21. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/types/prompt_template.py +0 -0
  22. {promptlayer-1.0.65 → promptlayer-1.0.67}/promptlayer/types/request_log.py +0 -0
@@ -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,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
 
@@ -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
  [tool.poetry]
2
2
  name = "promptlayer"
3
- version = "1.0.65"
3
+ version = "1.0.67"
4
4
  description = "PromptLayer is a platform for prompt engineering and tracks your LLM requests."
5
5
  authors = ["Magniv <hello@magniv.io>"]
6
6
  license = "Apache-2.0"
File without changes
File without changes