lmnr 0.4.24__py3-none-any.whl → 0.4.26__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/evaluations.py CHANGED
@@ -99,8 +99,8 @@ class Evaluation:
99
99
  data: Union[EvaluationDataset, list[Union[Datapoint, dict]]],
100
100
  executor: Any,
101
101
  evaluators: dict[str, EvaluatorFunction],
102
- group_id: Optional[str] = None,
103
102
  name: Optional[str] = None,
103
+ group_id: Optional[str] = None,
104
104
  batch_size: int = DEFAULT_BATCH_SIZE,
105
105
  project_api_key: Optional[str] = None,
106
106
  base_url: Optional[str] = None,
@@ -126,25 +126,33 @@ class Evaluation:
126
126
  If the score is a single number, it will be named after the\
127
127
  evaluator function. Evaluator function names must contain only\
128
128
  letters, digits, hyphens, underscores, or spaces.
129
- group_id (Optional[str], optional): Group id of the evaluation.
130
- Defaults to "default".
131
- name (Optional[str], optional): The name of the evaluation.\
132
- It will be auto-generated if not provided.
133
- batch_size (int, optional): The batch size for evaluation.
134
- Defaults to DEFAULT_BATCH_SIZE.
135
- project_api_key (Optional[str], optional): The project API key.
136
- Defaults to an empty string.
129
+ name (Optional[str], optional): Optional name of the evaluation.\
130
+ Used to identify the evaluation in the group.\
131
+ If not provided, a random name will be generated.
132
+ Defaults to None.
133
+ group_id (Optional[str], optional): an identifier to group\
134
+ evaluations. Only evaluations within the same group_id can be\
135
+ visually compared. If not provided, "default" is assigned.
136
+ Defaults to None
137
+ batch_size (int, optional): The batch size for evaluation. This many\
138
+ data points will be evaluated in parallel.
139
+ Defaults to DEFAULT_BATCH_SIZE.
140
+ project_api_key (Optional[str], optional): The project API key.\
141
+ If not provided, LMNR_PROJECT_API_KEY environment variable is\
142
+ used.
143
+ Defaults to an empty string.
137
144
  base_url (Optional[str], optional): The base URL for Laminar API.\
138
- Useful if self-hosted elsewhere. Do NOT include the\
139
- port, use `http_port` and `grpc_port` instead.
140
- Defaults to "https://api.lmnr.ai".
145
+ Useful if self-hosted. Do NOT include the port, use `http_port`\
146
+ and `grpc_port` instead.
147
+ Defaults to "https://api.lmnr.ai".
141
148
  http_port (Optional[int], optional): The port for Laminar API\
142
- HTTP service. Defaults to 443 if not specified.
149
+ HTTP service. Defaults to 443 if not specified.
143
150
  grpc_port (Optional[int], optional): The port for Laminar API\
144
- gRPC service. Defaults to 8443 if not specified.
151
+ gRPC service. Defaults to 8443 if not specified.
145
152
  instruments (Optional[Set[Instruments]], optional): Set of modules\
146
153
  to auto-instrument. If None, all available instruments will be\
147
154
  used.
155
+ See https://docs.lmnr.ai/tracing/automatic-instrumentation
148
156
  Defaults to None.
149
157
  """
150
158
 
@@ -284,8 +292,8 @@ def evaluate(
284
292
  data: Union[EvaluationDataset, list[Union[Datapoint, dict]]],
285
293
  executor: ExecutorFunction,
286
294
  evaluators: dict[str, EvaluatorFunction],
287
- group_id: Optional[str] = None,
288
295
  name: Optional[str] = None,
296
+ group_id: Optional[str] = None,
289
297
  batch_size: int = DEFAULT_BATCH_SIZE,
290
298
  project_api_key: Optional[str] = None,
291
299
  base_url: Optional[str] = None,
@@ -318,16 +326,14 @@ def evaluate(
318
326
  If the score is a single number, it will be named after the\
319
327
  evaluator function. Evaluator function names must contain only\
320
328
  letters, digits, hyphens, underscores, or spaces.
321
- group_id (Optional[str], optional): an identifier to group evaluations.\
322
- It is practical to group evaluations that evaluate\
323
- the same feature on the same dataset, to be able to\
324
- view their comparisons in the same place. If not\
325
- provided, defaults to "default".
326
- Defaults to None
327
329
  name (Optional[str], optional): Optional name of the evaluation.\
328
330
  Used to identify the evaluation in the group.\
329
331
  If not provided, a random name will be generated.
330
332
  Defaults to None.
333
+ group_id (Optional[str], optional): an identifier to group evaluations.\
334
+ Only evaluations within the same group_id can be\
335
+ visually compared. If not provided, set to "default".
336
+ Defaults to None
331
337
  batch_size (int, optional): The batch size for evaluation.
332
338
  Defaults to DEFAULT_BATCH_SIZE.
333
339
  project_api_key (Optional[str], optional): The project API key.
lmnr/sdk/laminar.py CHANGED
@@ -308,7 +308,7 @@ class Laminar:
308
308
  with get_tracer() as tracer:
309
309
  span_path = get_span_path(name)
310
310
  ctx = set_value("span_path", span_path)
311
- ctx_token = attach(set_value("span_path", span_path))
311
+ ctx_token = attach(ctx)
312
312
  with tracer.start_as_current_span(
313
313
  name,
314
314
  context=ctx,
@@ -317,7 +317,7 @@ class Laminar:
317
317
  if input is not None:
318
318
  span.set_attribute(
319
319
  SPAN_INPUT,
320
- json.dumps(input),
320
+ json_dumps(input),
321
321
  )
322
322
  span.set_attribute(SPAN_TYPE, span_type)
323
323
  yield span
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lmnr
3
- Version: 0.4.24
3
+ Version: 0.4.26
4
4
  Summary: Python SDK for Laminar AI
5
5
  License: Apache-2.0
6
6
  Author: lmnr.ai
@@ -247,6 +247,7 @@ You can run evaluations locally by providing executor (part of the logic used in
247
247
  - `executor` – the logic you want to evaluate. This function must take `data` as the first argument, and produce any output. It can be both a function or an `async` function.
248
248
  - `evaluators` – Dictionary which maps evaluator names to evaluators. Functions that take output of executor as the first argument, `target` as the second argument and produce a numeric scores. Each function can produce either a single number or `dict[str, int|float]` of scores. Each evaluator can be both a function or an `async` function.
249
249
  - `name` – optional name for the evaluation. Automatically generated if not provided.
250
+ - `group_id` – optional group name for the evaluation. Evaluations within the same group can be compared visually side-by-side
250
251
 
251
252
  \* If you already have the outputs of executors you want to evaluate, you can specify the executor as an identity function, that takes in `data` and returns only needed value(s) from it.
252
253
 
@@ -3,8 +3,8 @@ lmnr/cli.py,sha256=Ptvm5dsNLKUY5lwnN8XkT5GtCYjzpRNi2WvefknB3OQ,1079
3
3
  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
- lmnr/sdk/evaluations.py,sha256=XzJDRAXmLWxhX3Px0WKocNQYWRZMkI2bG-_Hb054lvA,14874
7
- lmnr/sdk/laminar.py,sha256=HLnXd7rKm8LlLGys-xukwmhdDsSaCYcMyWyeEgD4Dyg,18428
6
+ lmnr/sdk/evaluations.py,sha256=vG788rSDppAGEvIpyglKvm8Ac_D5cw07a6btMeMr8AI,15124
7
+ lmnr/sdk/laminar.py,sha256=vMp_mhirG1IPKxRjfUgbeHPKDW98GP2oHrDweJ2vu-c,18398
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.24.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
49
- lmnr-0.4.24.dist-info/METADATA,sha256=XcxnC9fKw0Hth1WXQcH_LZpT9A4TJDqWwbPre696nQU,10533
50
- lmnr-0.4.24.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
51
- lmnr-0.4.24.dist-info/entry_points.txt,sha256=K1jE20ww4jzHNZLnsfWBvU3YKDGBgbOiYG5Y7ivQcq4,37
52
- lmnr-0.4.24.dist-info/RECORD,,
48
+ lmnr-0.4.26.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
49
+ lmnr-0.4.26.dist-info/METADATA,sha256=AvPOPlTsnPvJkVALFJTdpiR4rZtnEKTwMpBPFyXW6ys,10662
50
+ lmnr-0.4.26.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
51
+ lmnr-0.4.26.dist-info/entry_points.txt,sha256=K1jE20ww4jzHNZLnsfWBvU3YKDGBgbOiYG5Y7ivQcq4,37
52
+ lmnr-0.4.26.dist-info/RECORD,,
File without changes
File without changes