lmnr 0.3.3__py3-none-any.whl → 0.3.5__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.
- lmnr/sdk/context.py +2 -2
- lmnr/sdk/decorators.py +3 -3
- lmnr/sdk/types.py +3 -1
- lmnr/sdk/utils.py +1 -4
- {lmnr-0.3.3.dist-info → lmnr-0.3.5.dist-info}/METADATA +4 -5
- {lmnr-0.3.3.dist-info → lmnr-0.3.5.dist-info}/RECORD +9 -9
- {lmnr-0.3.3.dist-info → lmnr-0.3.5.dist-info}/LICENSE +0 -0
- {lmnr-0.3.3.dist-info → lmnr-0.3.5.dist-info}/WHEEL +0 -0
- {lmnr-0.3.3.dist-info → lmnr-0.3.5.dist-info}/entry_points.txt +0 -0
lmnr/sdk/context.py
CHANGED
@@ -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,
|
lmnr/sdk/decorators.py
CHANGED
@@ -168,12 +168,12 @@ class LaminarDecorator:
|
|
168
168
|
laminar = LaminarSingleton().get()
|
169
169
|
laminar.evaluate_event(name, data)
|
170
170
|
|
171
|
-
def
|
171
|
+
def run(
|
172
172
|
self,
|
173
173
|
pipeline: str,
|
174
174
|
inputs: dict[str, NodeInput],
|
175
|
-
env: dict[str, str] =
|
176
|
-
metadata: dict[str, str] =
|
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
|
|
lmnr/sdk/types.py
CHANGED
@@ -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,
|
lmnr/sdk/utils.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lmnr
|
3
|
-
Version: 0.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
|
-
-
|
45
|
-
-
|
46
|
-
-
|
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
|
|
@@ -3,8 +3,8 @@ lmnr/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
lmnr/sdk/client.py,sha256=e6cIvJq38a6XAU8FGWYtNXVAPlEoZEyKS7hC3M_6EkU,5749
|
4
4
|
lmnr/sdk/collector.py,sha256=6LRmPhOcmGplUDWm_sJh0dVrLTHknd_kmq7POGuAvoQ,5338
|
5
5
|
lmnr/sdk/constants.py,sha256=USCfwuUqRx6_0xC8WUxqGj766dInqQkWJcf8U5vPK7s,34
|
6
|
-
lmnr/sdk/context.py,sha256=
|
7
|
-
lmnr/sdk/decorators.py,sha256=
|
6
|
+
lmnr/sdk/context.py,sha256=4ngtUYhix91hUW4Kpo-WplDiNs-SCqz6LmHMl84StoA,15398
|
7
|
+
lmnr/sdk/decorators.py,sha256=vEGXYJUKGNVAVEt3sRKAUTtGAdhfQbyA474kfHsZHTk,12024
|
8
8
|
lmnr/sdk/interface.py,sha256=ugtNIcHZhHC_qSyu_-1Fm62_phOb4vW-Lo5VZ1WaMhc,12255
|
9
9
|
lmnr/sdk/providers/__init__.py,sha256=wNCgQnt9-bnTNXLQWdPgyKhqA1ajiaEd1Rr2KPOpazM,54
|
10
10
|
lmnr/sdk/providers/base.py,sha256=xc6iA8yY_VK6tbzswt-3naZ53aAXtOLur9j8eimC_ZA,1054
|
@@ -12,12 +12,12 @@ lmnr/sdk/providers/fallback.py,sha256=9-srLJgDK5CWD8DIdnxo6jbSsnwDvdHC-vA06BfEkq
|
|
12
12
|
lmnr/sdk/providers/openai.py,sha256=9X2VWz4_EqQBEA1UEww2EKdqods6IzOEmaO6dnhY-Lw,5725
|
13
13
|
lmnr/sdk/providers/utils.py,sha256=ROt82VrvezExYOxionAynD3dp6oX5JoPW6F1ayTm7q8,946
|
14
14
|
lmnr/sdk/tracing_types.py,sha256=O6sfTBRKxz8WtRy4uEr-_wkSqu58mmEa1SXXJXDGwBI,6267
|
15
|
-
lmnr/sdk/types.py,sha256=
|
16
|
-
lmnr/sdk/utils.py,sha256=
|
15
|
+
lmnr/sdk/types.py,sha256=5-Ft-l35wtmn2xxE8BTqsM3nx1zD799tRv4qiOkED50,2121
|
16
|
+
lmnr/sdk/utils.py,sha256=50S-vT2ewiFsdx8-xADnqIM5EAJibw188cX-vo6eJvA,3293
|
17
17
|
lmnr/semantic_conventions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
18
18
|
lmnr/semantic_conventions/gen_ai_spans.py,sha256=3s-2J5v3t5LcMKwK2DefPn56XpxN5oMEYtb9Mf9D_gA,1541
|
19
|
-
lmnr-0.3.
|
20
|
-
lmnr-0.3.
|
21
|
-
lmnr-0.3.
|
22
|
-
lmnr-0.3.
|
23
|
-
lmnr-0.3.
|
19
|
+
lmnr-0.3.5.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
|
20
|
+
lmnr-0.3.5.dist-info/METADATA,sha256=_J5SNvkuWZORu6XWBiaMnxsDpgjozx4crNsV45-8-2E,9485
|
21
|
+
lmnr-0.3.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
22
|
+
lmnr-0.3.5.dist-info/entry_points.txt,sha256=Qg7ZRax4k-rcQsZ26XRYQ8YFSBiyY2PNxYfq4a6PYXI,41
|
23
|
+
lmnr-0.3.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|