langwatch 0.3.0__py3-none-any.whl → 0.3.1__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.
langwatch/__version__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Version information for LangWatch."""
2
2
 
3
- __version__ = "0.2.19"
3
+ __version__ = "0.3.1"
@@ -21,7 +21,7 @@ class PromptTracing:
21
21
  """Internal method to create compile decorators with specified span name"""
22
22
 
23
23
  def decorator(
24
- func: Callable[..., "CompiledPrompt"]
24
+ func: Callable[..., "CompiledPrompt"],
25
25
  ) -> Callable[..., "CompiledPrompt"]:
26
26
  @wraps(func)
27
27
  def wrapper(self: "Prompt", *args: Any, **kwargs: Any) -> "CompiledPrompt":
@@ -31,10 +31,16 @@ class PromptTracing:
31
31
  # Set base prompt
32
32
  span.set_attributes(
33
33
  {
34
- AttributeKey.LangWatchPromptId: self.id,
35
- AttributeKey.LangWatchPromptHandle: self.handle,
36
- AttributeKey.LangWatchPromptVersionId: self.version_id,
37
- AttributeKey.LangWatchPromptVersionNumber: self.version,
34
+ AttributeKey.LangWatchPromptId: getattr(self, "id", None),
35
+ AttributeKey.LangWatchPromptHandle: getattr(
36
+ self, "handle", None
37
+ ),
38
+ AttributeKey.LangWatchPromptVersionId: getattr(
39
+ self, "version_id", None
40
+ ),
41
+ AttributeKey.LangWatchPromptVersionNumber: getattr(
42
+ self, "version", None
43
+ ),
38
44
  }
39
45
  )
40
46
 
@@ -67,14 +73,14 @@ class PromptTracing:
67
73
 
68
74
  @staticmethod
69
75
  def compile(
70
- func: Callable[..., "CompiledPrompt"]
76
+ func: Callable[..., "CompiledPrompt"],
71
77
  ) -> Callable[..., "CompiledPrompt"]:
72
78
  """Decorator for Prompt.compile method with OpenTelemetry tracing"""
73
79
  return PromptTracing._create_compile_decorator("compile")(func)
74
80
 
75
81
  @staticmethod
76
82
  def compile_strict(
77
- func: Callable[..., "CompiledPrompt"]
83
+ func: Callable[..., "CompiledPrompt"],
78
84
  ) -> Callable[..., "CompiledPrompt"]:
79
85
  """Decorator for Prompt.compile_strict method with OpenTelemetry tracing"""
80
86
  return PromptTracing._create_compile_decorator("compile_strict")(func)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langwatch
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: LangWatch Python SDK, for monitoring your LLMs
5
5
  Author-email: Langwatch Engineers <engineering@langwatch.ai>
6
6
  License: MIT
@@ -1,5 +1,5 @@
1
1
  langwatch/__init__.py,sha256=TzPHzqCFGZJByI3sAIKrNB33Qi4PqVmgYDZuBwPnhPc,4222
2
- langwatch/__version__.py,sha256=T662oKEbI_44dfZPwhufI1p7OvdgFjxO-wfa1hX2NGM,65
2
+ langwatch/__version__.py,sha256=76Y19D8flgXvQE1gQJQMULzN9YyGslJSW_cUX8J6s6I,64
3
3
  langwatch/attributes.py,sha256=nXdI_G85wQQCAdAcwjCiLYdEYj3wATmfgCmhlf6dVIk,3910
4
4
  langwatch/batch_evaluation.py,sha256=piez7TYqUZPb9NlIShTuTPmSzrZqX-vm2Grz_NGXe04,16078
5
5
  langwatch/client.py,sha256=WTNcYSik7kZ2kH-qGDnhbMTosc8e_Xhab_lZlfh5TC8,25559
@@ -390,7 +390,7 @@ langwatch/prompts/prompt_api_service.py,sha256=tHhwIRjUBSM43_jwDAoGCHJjvvqVeSCrU
390
390
  langwatch/prompts/prompt_facade.py,sha256=47matSK4G2Ce3HWUnO13-k7jlDuZQePGCck4gkbTmXM,5052
391
391
  langwatch/prompts/types.py,sha256=p1bRMvfCCpGGiVwzFtQijVtWl5GWugL_vBOFc4B2348,269
392
392
  langwatch/prompts/decorators/prompt_service_tracing.py,sha256=uSYw0vExo7AuxbcCRnxbYl6UOfOQSC0IsisSqYy153Y,2395
393
- langwatch/prompts/decorators/prompt_tracing.py,sha256=Q3-RM8G-PHkBjVKntSg3c8H2o0P1bpO3UbR3uRgbke0,3182
393
+ langwatch/prompts/decorators/prompt_tracing.py,sha256=GD1iA7j7_BzqO7iwkRUt4-RQrursuRg1gvtu89SsiY8,3443
394
394
  langwatch/prompts/types/__init__.py,sha256=uEnjOQC4LkLMWQ0fXfKe573xKOvoMdPgC6uY-yo9B_g,506
395
395
  langwatch/prompts/types/prompt_data.py,sha256=g_EQ94-PGfa4Ptwd3e2rMqoIZiX052MEEZKyF77m9D0,3137
396
396
  langwatch/prompts/types/structures.py,sha256=cB94bn-qhFgHHYXcrmJV6Bk9idk5ZmyfXhFNQAaXw-M,951
@@ -407,6 +407,6 @@ langwatch/utils/initialization.py,sha256=1KoZmkHOvGEVF0j-4t4xRQdA_2C_SPiF7qFXqEG
407
407
  langwatch/utils/module.py,sha256=KLBNOK3mA9gCSifCcQX_lOtU48BJQDWvFKtF6NMvwVA,688
408
408
  langwatch/utils/transformation.py,sha256=76MGXyrYTxM0Yri36NJqLK-XxL4BBYdmKWAXXlw3D4Q,7690
409
409
  langwatch/utils/utils.py,sha256=ZCOSie4o9LdJ7odshNfCNjmgwgQ27ojc5ENqt1rXuSs,596
410
- langwatch-0.3.0.dist-info/METADATA,sha256=uj8bX5xlgiz5q0Ozwvl1Z6rGoU_t60gk0WZc9goqJd0,13123
411
- langwatch-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
412
- langwatch-0.3.0.dist-info/RECORD,,
410
+ langwatch-0.3.1.dist-info/METADATA,sha256=RhkQSUrkCjU-O4v2J-MBLavOEYaML6VtK1MmE1CJBPE,13123
411
+ langwatch-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
412
+ langwatch-0.3.1.dist-info/RECORD,,