lmnr 0.3.3__tar.gz → 0.3.5__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.3.3
3
+ Version: 0.3.5
4
4
  Summary: Python SDK for Laminar AI
5
5
  License: Apache-2.0
6
6
  Author: lmnr.ai
@@ -41,13 +41,12 @@ You can send events in two ways:
41
41
  - `.evaluate_event(name, data)` – for an event that our agent checks for and assigns a value from possible values.
42
42
 
43
43
  There are 3 types of events:
44
- - SCORE - this is an integer score where you specify inclusive minimum and maximum.
45
- - CLASS - this is a classifier with one of the possible values.
46
- - TAG - this event has no value and can be assigned to a span.
44
+ - Number - Numeric value.
45
+ - String - Arbitrary string.
46
+ - Boolean - Convenient to classify if something has took place or not.
47
47
 
48
48
  Important notes:
49
49
  - If event name does not match anything pre-defined in the UI, the event won't be saved.
50
- - If event value (when sent with `.event()`) is not in the domain, the event won't be saved.
51
50
 
52
51
  ## Instrumentation
53
52
 
@@ -21,13 +21,12 @@ You can send events in two ways:
21
21
  - `.evaluate_event(name, data)` – for an event that our agent checks for and assigns a value from possible values.
22
22
 
23
23
  There are 3 types of events:
24
- - SCORE - this is an integer score where you specify inclusive minimum and maximum.
25
- - CLASS - this is a classifier with one of the possible values.
26
- - TAG - this event has no value and can be assigned to a span.
24
+ - Number - Numeric value.
25
+ - String - Arbitrary string.
26
+ - Boolean - Convenient to classify if something has took place or not.
27
27
 
28
28
  Important notes:
29
29
  - If event name does not match anything pre-defined in the UI, the event won't be saved.
30
- - If event value (when sent with `.event()`) is not in the domain, the event won't be saved.
31
30
 
32
31
  ## Instrumentation
33
32
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lmnr"
3
- version = "0.3.3"
3
+ version = "0.3.5"
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.3.3"
14
+ version = "0.3.5"
15
15
  description = "Python SDK for Laminar AI"
16
16
  authors = ["lmnr.ai"]
17
17
  readme = "README.md"
@@ -269,9 +269,9 @@ class LaminarContextManager:
269
269
  ) -> Span:
270
270
  """Internal method to update a span object. Use `SpanContext.update()` instead."""
271
271
  span.update(
272
- input=input,
272
+ input=input or span.input,
273
+ output=output or span.output,
273
274
  end_time=end_time,
274
- output=output,
275
275
  metadata=metadata,
276
276
  attributes=attributes,
277
277
  evaluate_events=evaluate_events,
@@ -168,12 +168,12 @@ class LaminarDecorator:
168
168
  laminar = LaminarSingleton().get()
169
169
  laminar.evaluate_event(name, data)
170
170
 
171
- def run_pipeline(
171
+ def run(
172
172
  self,
173
173
  pipeline: str,
174
174
  inputs: dict[str, NodeInput],
175
- env: dict[str, str] = None,
176
- metadata: dict[str, str] = None,
175
+ env: dict[str, str] = {},
176
+ metadata: dict[str, str] = {},
177
177
  ) -> PipelineRunResponse:
178
178
  """Run the laminar pipeline with the given inputs. Pipeline must be defined in the Laminar UI and have a target version.
179
179
 
@@ -3,6 +3,8 @@ import pydantic
3
3
  import uuid
4
4
  from typing import Optional, Union
5
5
 
6
+ from .utils import to_dict
7
+
6
8
 
7
9
  class ChatMessage(pydantic.BaseModel):
8
10
  role: str
@@ -30,7 +32,7 @@ class PipelineRunRequest(pydantic.BaseModel):
30
32
  def to_dict(self):
31
33
  return {
32
34
  "inputs": {
33
- k: v.model_dump() if isinstance(v, pydantic.BaseModel) else v
35
+ k: v.model_dump() if isinstance(v, pydantic.BaseModel) else to_dict(v)
34
36
  for k, v in self.inputs.items()
35
37
  },
36
38
  "pipeline": self.pipeline,
@@ -76,10 +76,7 @@ def to_dict(obj: typing.Any) -> dict[str, typing.Any]:
76
76
 
77
77
  return str(o)
78
78
 
79
- for key in obj.keys():
80
- obj[key] = to_dict_inner(obj[key])
81
-
82
- return obj
79
+ return to_dict_inner(obj)
83
80
 
84
81
 
85
82
  def get_input_from_func_args(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes