lmnr 0.4.5__tar.gz → 0.4.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lmnr
3
- Version: 0.4.5
3
+ Version: 0.4.6
4
4
  Summary: Python SDK for Laminar AI
5
5
  License: Apache-2.0
6
6
  Author: lmnr.ai
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lmnr"
3
- version = "0.4.5"
3
+ version = "0.4.6"
4
4
  description = "Python SDK for Laminar AI"
5
5
  authors = [
6
6
  { name = "lmnr.ai", email = "founders@lmnr.ai" }
@@ -11,7 +11,7 @@ license = "Apache-2.0"
11
11
 
12
12
  [tool.poetry]
13
13
  name = "lmnr"
14
- version = "0.4.5"
14
+ version = "0.4.6"
15
15
  description = "Python SDK for Laminar AI"
16
16
  authors = ["lmnr.ai"]
17
17
  readme = "README.md"
@@ -9,6 +9,7 @@ from opentelemetry.semconv_ai import SpanAttributes
9
9
  from opentelemetry.util.types import AttributeValue
10
10
  from traceloop.sdk import Traceloop
11
11
  from traceloop.sdk.tracing import get_tracer
12
+ from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
12
13
 
13
14
  from pydantic.alias_generators import to_snake
14
15
  from typing import Any, Optional, Union
@@ -35,7 +36,7 @@ from .types import (
35
36
 
36
37
 
37
38
  class Laminar:
38
- __base_url: str = "https://api.lmnr.ai"
39
+ __base_url: str = "https://api.lmnr.ai:8443"
39
40
  __project_api_key: Optional[str] = None
40
41
  __env: dict[str, str] = {}
41
42
  __initialized: bool = False
@@ -67,9 +68,9 @@ class Laminar:
67
68
  base_url (Optional[str], optional): Url of Laminar endpoint,
68
69
  or the customopen telemetry ingester.
69
70
  If not specified, defaults to
70
- https://api.lmnr.ai.
71
+ https://api.lmnr.ai:8443.
71
72
  For locally hosted Laminar, default setting
72
- must be http://localhost:8000
73
+ must be http://localhost:8001
73
74
  Defaults to None.
74
75
 
75
76
  Raises:
@@ -97,6 +98,10 @@ class Laminar:
97
98
  Traceloop.init(
98
99
  api_endpoint=cls.__base_url,
99
100
  api_key=cls.__project_api_key,
101
+ exporter=OTLPSpanExporter(
102
+ endpoint=cls.__base_url,
103
+ headers={"authorization": f"Bearer {cls.__project_api_key}"},
104
+ ),
100
105
  )
101
106
 
102
107
  @classmethod
@@ -247,7 +252,7 @@ class Laminar:
247
252
  name: str,
248
253
  evaluator: str,
249
254
  data: dict[str, AttributeValue],
250
- env: Optional[dict[str, str]] = {},
255
+ env: Optional[dict[str, str]] = None,
251
256
  timestamp: Optional[Union[datetime.datetime, int]] = None,
252
257
  ):
253
258
  """Send an event for evaluation to the Laminar backend
@@ -330,7 +335,7 @@ class Laminar:
330
335
  """
331
336
  if output is not None:
332
337
  span.set_attribute(
333
- SpanAttributes.TRACELOOP_ENTITY_OUTPUT, json.dumps({output})
338
+ SpanAttributes.TRACELOOP_ENTITY_OUTPUT, json.dumps(output)
334
339
  )
335
340
 
336
341
  @classmethod
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes