promptlayer 1.0.18__tar.gz → 1.0.19__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: promptlayer
3
- Version: 1.0.18
3
+ Version: 1.0.19
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 PromptLayer
2
2
 
3
- __version__ = "1.0.18"
3
+ __version__ = "1.0.19"
4
4
  __all__ = ["PromptLayer", "__version__"]
@@ -356,12 +356,13 @@ class PromptLayer:
356
356
  else:
357
357
  return self._run_internal(**_run_internal_kwargs)
358
358
 
359
- def traceable(self, attributes=None):
359
+ def traceable(self, attributes=None, name=None):
360
360
  def decorator(func):
361
361
  @wraps(func)
362
362
  def sync_wrapper(*args, **kwargs):
363
363
  if self.tracer:
364
- with self.tracer.start_as_current_span(func.__name__) as span:
364
+ span_name = name or func.__name__
365
+ with self.tracer.start_as_current_span(span_name) as span:
365
366
  if attributes:
366
367
  for key, value in attributes.items():
367
368
  span.set_attribute(key, value)
@@ -379,7 +380,8 @@ class PromptLayer:
379
380
  @wraps(func)
380
381
  async def async_wrapper(*args, **kwargs):
381
382
  if self.tracer:
382
- with self.tracer.start_as_current_span(func.__name__) as span:
383
+ span_name = name or func.__name__
384
+ with self.tracer.start_as_current_span(span_name) as span:
383
385
  if attributes:
384
386
  for key, value in attributes.items():
385
387
  span.set_attribute(key, value)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "promptlayer"
3
- version = "1.0.18"
3
+ version = "1.0.19"
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