lmnr 0.4.25__py3-none-any.whl → 0.4.27__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/laminar.py +16 -6
- {lmnr-0.4.25.dist-info → lmnr-0.4.27.dist-info}/METADATA +26 -27
- {lmnr-0.4.25.dist-info → lmnr-0.4.27.dist-info}/RECORD +6 -6
- {lmnr-0.4.25.dist-info → lmnr-0.4.27.dist-info}/LICENSE +0 -0
- {lmnr-0.4.25.dist-info → lmnr-0.4.27.dist-info}/WHEEL +0 -0
- {lmnr-0.4.25.dist-info → lmnr-0.4.27.dist-info}/entry_points.txt +0 -0
lmnr/sdk/laminar.py
CHANGED
@@ -61,6 +61,7 @@ class Laminar:
|
|
61
61
|
__project_api_key: Optional[str] = None
|
62
62
|
__env: dict[str, str] = {}
|
63
63
|
__initialized: bool = False
|
64
|
+
__http_session: Optional[requests.Session] = None
|
64
65
|
|
65
66
|
@classmethod
|
66
67
|
def initialize(
|
@@ -125,6 +126,7 @@ class Laminar:
|
|
125
126
|
cls.__env = env
|
126
127
|
cls.__initialized = True
|
127
128
|
cls._initialize_logger()
|
129
|
+
cls.__http_session = requests.Session()
|
128
130
|
Traceloop.init(
|
129
131
|
exporter=OTLPSpanExporter(
|
130
132
|
endpoint=cls.__base_grpc_url,
|
@@ -213,10 +215,18 @@ class Laminar:
|
|
213
215
|
except Exception as e:
|
214
216
|
raise ValueError(f"Invalid request: {e}")
|
215
217
|
|
216
|
-
response =
|
217
|
-
cls.
|
218
|
-
|
219
|
-
|
218
|
+
response = (
|
219
|
+
cls.__http_session.post(
|
220
|
+
cls.__base_http_url + "/v1/pipeline/run",
|
221
|
+
data=json.dumps(request.to_dict()),
|
222
|
+
headers=cls._headers(),
|
223
|
+
)
|
224
|
+
if cls.__http_session
|
225
|
+
else requests.post(
|
226
|
+
cls.__base_http_url + "/v1/pipeline/run",
|
227
|
+
data=json.dumps(request.to_dict()),
|
228
|
+
headers=cls._headers(),
|
229
|
+
)
|
220
230
|
)
|
221
231
|
if response.status_code != 200:
|
222
232
|
raise PipelineRunError(response)
|
@@ -308,7 +318,7 @@ class Laminar:
|
|
308
318
|
with get_tracer() as tracer:
|
309
319
|
span_path = get_span_path(name)
|
310
320
|
ctx = set_value("span_path", span_path)
|
311
|
-
ctx_token = attach(
|
321
|
+
ctx_token = attach(ctx)
|
312
322
|
with tracer.start_as_current_span(
|
313
323
|
name,
|
314
324
|
context=ctx,
|
@@ -317,7 +327,7 @@ class Laminar:
|
|
317
327
|
if input is not None:
|
318
328
|
span.set_attribute(
|
319
329
|
SPAN_INPUT,
|
320
|
-
|
330
|
+
json_dumps(input),
|
321
331
|
)
|
322
332
|
span.set_attribute(SPAN_TYPE, span_type)
|
323
333
|
yield span
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: lmnr
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.27
|
4
4
|
Summary: Python SDK for Laminar AI
|
5
5
|
License: Apache-2.0
|
6
6
|
Author: lmnr.ai
|
@@ -16,40 +16,39 @@ Requires-Dist: argparse (>=1.0,<2.0)
|
|
16
16
|
Requires-Dist: backoff (>=2.0,<3.0)
|
17
17
|
Requires-Dist: deprecated (>=1.0,<2.0)
|
18
18
|
Requires-Dist: jinja2 (>=3.0,<4.0)
|
19
|
-
Requires-Dist: openai (>=1.52.0,<2.0.0)
|
20
19
|
Requires-Dist: opentelemetry-api (>=1.27.0,<2.0.0)
|
21
20
|
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc (>=1.27.0,<2.0.0)
|
22
21
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.27.0,<2.0.0)
|
23
|
-
Requires-Dist: opentelemetry-instrumentation-alephalpha (>=0.33.
|
24
|
-
Requires-Dist: opentelemetry-instrumentation-anthropic (>=0.33.
|
25
|
-
Requires-Dist: opentelemetry-instrumentation-bedrock (>=0.33.
|
26
|
-
Requires-Dist: opentelemetry-instrumentation-chromadb (>=0.33.
|
27
|
-
Requires-Dist: opentelemetry-instrumentation-cohere (>=0.33.
|
28
|
-
Requires-Dist: opentelemetry-instrumentation-google-generativeai (>=0.33.
|
29
|
-
Requires-Dist: opentelemetry-instrumentation-groq (>=0.33.
|
30
|
-
Requires-Dist: opentelemetry-instrumentation-haystack (>=0.33.
|
31
|
-
Requires-Dist: opentelemetry-instrumentation-lancedb (>=0.33.
|
32
|
-
Requires-Dist: opentelemetry-instrumentation-langchain (>=0.33.
|
33
|
-
Requires-Dist: opentelemetry-instrumentation-llamaindex (>=0.33.
|
34
|
-
Requires-Dist: opentelemetry-instrumentation-marqo (>=0.33.
|
35
|
-
Requires-Dist: opentelemetry-instrumentation-milvus (>=0.33.
|
36
|
-
Requires-Dist: opentelemetry-instrumentation-mistralai (>=0.33.
|
37
|
-
Requires-Dist: opentelemetry-instrumentation-ollama (>=0.33.
|
38
|
-
Requires-Dist: opentelemetry-instrumentation-openai (>=0.33.
|
39
|
-
Requires-Dist: opentelemetry-instrumentation-pinecone (>=0.33.
|
40
|
-
Requires-Dist: opentelemetry-instrumentation-qdrant (>=0.33.
|
41
|
-
Requires-Dist: opentelemetry-instrumentation-replicate (>=0.33.
|
22
|
+
Requires-Dist: opentelemetry-instrumentation-alephalpha (>=0.33.5)
|
23
|
+
Requires-Dist: opentelemetry-instrumentation-anthropic (>=0.33.5)
|
24
|
+
Requires-Dist: opentelemetry-instrumentation-bedrock (>=0.33.5)
|
25
|
+
Requires-Dist: opentelemetry-instrumentation-chromadb (>=0.33.5)
|
26
|
+
Requires-Dist: opentelemetry-instrumentation-cohere (>=0.33.5)
|
27
|
+
Requires-Dist: opentelemetry-instrumentation-google-generativeai (>=0.33.5)
|
28
|
+
Requires-Dist: opentelemetry-instrumentation-groq (>=0.33.5)
|
29
|
+
Requires-Dist: opentelemetry-instrumentation-haystack (>=0.33.5)
|
30
|
+
Requires-Dist: opentelemetry-instrumentation-lancedb (>=0.33.5)
|
31
|
+
Requires-Dist: opentelemetry-instrumentation-langchain (>=0.33.5)
|
32
|
+
Requires-Dist: opentelemetry-instrumentation-llamaindex (>=0.33.5)
|
33
|
+
Requires-Dist: opentelemetry-instrumentation-marqo (>=0.33.5)
|
34
|
+
Requires-Dist: opentelemetry-instrumentation-milvus (>=0.33.5)
|
35
|
+
Requires-Dist: opentelemetry-instrumentation-mistralai (>=0.33.5)
|
36
|
+
Requires-Dist: opentelemetry-instrumentation-ollama (>=0.33.5)
|
37
|
+
Requires-Dist: opentelemetry-instrumentation-openai (>=0.33.5)
|
38
|
+
Requires-Dist: opentelemetry-instrumentation-pinecone (>=0.33.5)
|
39
|
+
Requires-Dist: opentelemetry-instrumentation-qdrant (>=0.33.5)
|
40
|
+
Requires-Dist: opentelemetry-instrumentation-replicate (>=0.33.5)
|
42
41
|
Requires-Dist: opentelemetry-instrumentation-requests (>=0.48b0,<0.49)
|
43
42
|
Requires-Dist: opentelemetry-instrumentation-sqlalchemy (>=0.48b0,<0.49)
|
44
43
|
Requires-Dist: opentelemetry-instrumentation-threading (>=0.48b0,<0.49)
|
45
|
-
Requires-Dist: opentelemetry-instrumentation-together (>=0.33.
|
46
|
-
Requires-Dist: opentelemetry-instrumentation-transformers (>=0.33.
|
44
|
+
Requires-Dist: opentelemetry-instrumentation-together (>=0.33.5)
|
45
|
+
Requires-Dist: opentelemetry-instrumentation-transformers (>=0.33.5)
|
47
46
|
Requires-Dist: opentelemetry-instrumentation-urllib3 (>=0.48b0,<0.49)
|
48
|
-
Requires-Dist: opentelemetry-instrumentation-vertexai (>=0.33.
|
49
|
-
Requires-Dist: opentelemetry-instrumentation-watsonx (>=0.33.
|
50
|
-
Requires-Dist: opentelemetry-instrumentation-weaviate (>=0.33.
|
47
|
+
Requires-Dist: opentelemetry-instrumentation-vertexai (>=0.33.5)
|
48
|
+
Requires-Dist: opentelemetry-instrumentation-watsonx (>=0.33.5)
|
49
|
+
Requires-Dist: opentelemetry-instrumentation-weaviate (>=0.33.5)
|
51
50
|
Requires-Dist: opentelemetry-sdk (>=1.27.0,<2.0.0)
|
52
|
-
Requires-Dist: opentelemetry-semantic-conventions-ai (==0.4.
|
51
|
+
Requires-Dist: opentelemetry-semantic-conventions-ai (==0.4.2)
|
53
52
|
Requires-Dist: pydantic (>=2.7,<3.0)
|
54
53
|
Requires-Dist: python-dotenv (>=1.0,<2.0)
|
55
54
|
Requires-Dist: requests (>=2.0,<3.0)
|
@@ -4,7 +4,7 @@ lmnr/sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
4
|
lmnr/sdk/datasets.py,sha256=V6q0Zcv7znx5cB1YZd0pBgTEcAKXbb-pEwguScEhBw0,1612
|
5
5
|
lmnr/sdk/decorators.py,sha256=ZSDaEZyjo-RUzRCltsNbe6x0t9SKl2xRQ2q4uaKvXtk,2250
|
6
6
|
lmnr/sdk/evaluations.py,sha256=vG788rSDppAGEvIpyglKvm8Ac_D5cw07a6btMeMr8AI,15124
|
7
|
-
lmnr/sdk/laminar.py,sha256=
|
7
|
+
lmnr/sdk/laminar.py,sha256=H87fXSWb9shcPW4AeoYwvTXJ-jSTjzm2sI1A1U1Vkg8,18780
|
8
8
|
lmnr/sdk/log.py,sha256=cZBeUoSK39LMEV-X4-eEhTWOciULRfHaKfRK8YqIM8I,1532
|
9
9
|
lmnr/sdk/types.py,sha256=6_C2LhcbI9PwlntnSuREE0FRsBUxc3WS_yC_Y_trPBI,5052
|
10
10
|
lmnr/sdk/utils.py,sha256=s81p6uJehgJSaLWy3sR5fTpEDH7vzn3i_UujUHChl6M,3346
|
@@ -45,8 +45,8 @@ lmnr/traceloop_sdk/utils/in_memory_span_exporter.py,sha256=H_4TRaThMO1H6vUQ0OpQv
|
|
45
45
|
lmnr/traceloop_sdk/utils/json_encoder.py,sha256=dK6b_axr70IYL7Vv-bu4wntvDDuyntoqsHaddqX7P58,463
|
46
46
|
lmnr/traceloop_sdk/utils/package_check.py,sha256=TZSngzJOpFhfUZLXIs38cpMxQiZSmp0D-sCrIyhz7BA,251
|
47
47
|
lmnr/traceloop_sdk/version.py,sha256=OlatFEFA4ttqSSIiV8jdE-sq3KG5zu2hnC4B4mzWF3s,23
|
48
|
-
lmnr-0.4.
|
49
|
-
lmnr-0.4.
|
50
|
-
lmnr-0.4.
|
51
|
-
lmnr-0.4.
|
52
|
-
lmnr-0.4.
|
48
|
+
lmnr-0.4.27.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
|
49
|
+
lmnr-0.4.27.dist-info/METADATA,sha256=QI26rjCwIxbUPQYfq6HquwkjmEwq0YPP8d5VNfRHJ_M,10622
|
50
|
+
lmnr-0.4.27.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
51
|
+
lmnr-0.4.27.dist-info/entry_points.txt,sha256=K1jE20ww4jzHNZLnsfWBvU3YKDGBgbOiYG5Y7ivQcq4,37
|
52
|
+
lmnr-0.4.27.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|