lmnr 0.3.3__tar.gz → 0.3.4__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.4
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.3.3"
3
+ version = "0.3.4"
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.4"
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,7 +168,7 @@ 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],
@@ -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
File without changes