lucidicai 2.0.1__py3-none-any.whl → 2.0.2__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.
- lucidicai/__init__.py +24 -0
- lucidicai/client.py +4 -1
- lucidicai/dataset.py +2 -0
- lucidicai/errors.py +6 -0
- lucidicai/feature_flag.py +8 -0
- {lucidicai-2.0.1.dist-info → lucidicai-2.0.2.dist-info}/METADATA +1 -1
- {lucidicai-2.0.1.dist-info → lucidicai-2.0.2.dist-info}/RECORD +9 -9
- {lucidicai-2.0.1.dist-info → lucidicai-2.0.2.dist-info}/WHEEL +0 -0
- {lucidicai-2.0.1.dist-info → lucidicai-2.0.2.dist-info}/top_level.txt +0 -0
lucidicai/__init__.py
CHANGED
|
@@ -28,6 +28,17 @@ from .context import (
|
|
|
28
28
|
run_session,
|
|
29
29
|
run_in_session,
|
|
30
30
|
)
|
|
31
|
+
from .dataset import get_dataset, get_dataset_items
|
|
32
|
+
from .feature_flag import (
|
|
33
|
+
get_feature_flag,
|
|
34
|
+
get_bool_flag,
|
|
35
|
+
get_int_flag,
|
|
36
|
+
get_float_flag,
|
|
37
|
+
get_string_flag,
|
|
38
|
+
get_json_flag,
|
|
39
|
+
clear_feature_flag_cache,
|
|
40
|
+
FeatureFlagError
|
|
41
|
+
)
|
|
31
42
|
|
|
32
43
|
ProviderType = Literal[
|
|
33
44
|
"openai",
|
|
@@ -229,6 +240,16 @@ __all__ = [
|
|
|
229
240
|
'end_session',
|
|
230
241
|
'get_prompt',
|
|
231
242
|
'get_session',
|
|
243
|
+
'get_dataset',
|
|
244
|
+
'get_dataset_items',
|
|
245
|
+
'get_feature_flag',
|
|
246
|
+
'get_bool_flag',
|
|
247
|
+
'get_int_flag',
|
|
248
|
+
'get_float_flag',
|
|
249
|
+
'get_string_flag',
|
|
250
|
+
'get_json_flag',
|
|
251
|
+
'clear_feature_flag_cache',
|
|
252
|
+
'FeatureFlagError',
|
|
232
253
|
'ProviderType',
|
|
233
254
|
'APIKeyVerificationError',
|
|
234
255
|
'LucidicNotInitializedError',
|
|
@@ -257,6 +278,7 @@ def init(
|
|
|
257
278
|
experiment_id: Optional[str] = None,
|
|
258
279
|
rubrics: Optional[list] = None,
|
|
259
280
|
tags: Optional[list] = None,
|
|
281
|
+
dataset_item_id: Optional[str] = None,
|
|
260
282
|
masking_function = None,
|
|
261
283
|
auto_end: Optional[bool] = True,
|
|
262
284
|
capture_uncaught: Optional[bool] = True,
|
|
@@ -274,6 +296,7 @@ def init(
|
|
|
274
296
|
experiment_id: Optional experiment ID, if session is to be part of an experiment.
|
|
275
297
|
rubrics: Optional rubrics for evaluation, list of strings.
|
|
276
298
|
tags: Optional tags for the session, list of strings.
|
|
299
|
+
dataset_item_id: Optional dataset item ID to link session to a dataset item.
|
|
277
300
|
masking_function: Optional function to mask sensitive data.
|
|
278
301
|
auto_end: If True, automatically end the session on process exit. Defaults to True.
|
|
279
302
|
|
|
@@ -328,6 +351,7 @@ def init(
|
|
|
328
351
|
production_monitoring=production_monitoring,
|
|
329
352
|
session_id=session_id,
|
|
330
353
|
experiment_id=experiment_id,
|
|
354
|
+
dataset_item_id=dataset_item_id,
|
|
331
355
|
)
|
|
332
356
|
if masking_function:
|
|
333
357
|
client.masking_function = masking_function
|
lucidicai/client.py
CHANGED
|
@@ -98,6 +98,7 @@ class Client:
|
|
|
98
98
|
production_monitoring: Optional[bool] = False,
|
|
99
99
|
session_id: Optional[str] = None,
|
|
100
100
|
experiment_id: Optional[str] = None,
|
|
101
|
+
dataset_item_id: Optional[str] = None,
|
|
101
102
|
) -> None:
|
|
102
103
|
if session_id:
|
|
103
104
|
# Check if it's a known session ID, maybe custom and maybe real
|
|
@@ -122,7 +123,9 @@ class Client:
|
|
|
122
123
|
"experiment_id": experiment_id,
|
|
123
124
|
"rubrics": rubrics,
|
|
124
125
|
"tags": tags,
|
|
125
|
-
"session_id": session_id
|
|
126
|
+
"session_id": session_id,
|
|
127
|
+
"dataset_item_id": dataset_item_id,
|
|
128
|
+
"production_monitoring": production_monitoring
|
|
126
129
|
}
|
|
127
130
|
data = self.make_request('initsession', 'POST', request_data)
|
|
128
131
|
real_session_id = data["session_id"]
|
lucidicai/dataset.py
CHANGED
|
@@ -37,6 +37,7 @@ def get_dataset(
|
|
|
37
37
|
APIKeyVerificationError: If API key or agent ID is missing or invalid.
|
|
38
38
|
ValueError: If dataset_id is not provided.
|
|
39
39
|
"""
|
|
40
|
+
return # no op for now
|
|
40
41
|
load_dotenv()
|
|
41
42
|
|
|
42
43
|
# Validation
|
|
@@ -108,5 +109,6 @@ def get_dataset_items(
|
|
|
108
109
|
APIKeyVerificationError: If API key or agent ID is missing or invalid.
|
|
109
110
|
ValueError: If dataset_id is not provided.
|
|
110
111
|
"""
|
|
112
|
+
return # no op for now
|
|
111
113
|
dataset = get_dataset(dataset_id, api_key, agent_id)
|
|
112
114
|
return dataset.get('items', [])
|
lucidicai/errors.py
CHANGED
|
@@ -23,6 +23,12 @@ class InvalidOperationError(Exception):
|
|
|
23
23
|
super().__init__(f"An invalid Lucidic operation was attempted: {message}")
|
|
24
24
|
|
|
25
25
|
|
|
26
|
+
class FeatureFlagError(Exception):
|
|
27
|
+
"""Exception for feature flag fetch failures"""
|
|
28
|
+
def __init__(self, message: str):
|
|
29
|
+
super().__init__(f"Failed to fetch feature flag: {message}")
|
|
30
|
+
|
|
31
|
+
|
|
26
32
|
def install_error_handler():
|
|
27
33
|
"""Install global handler to create ERROR_TRACEBACK events for uncaught exceptions."""
|
|
28
34
|
from .client import Client
|
lucidicai/feature_flag.py
CHANGED
|
@@ -134,6 +134,9 @@ def get_feature_flag(
|
|
|
134
134
|
defaults={"max_retries": 3}
|
|
135
135
|
)
|
|
136
136
|
"""
|
|
137
|
+
|
|
138
|
+
return # no op for now
|
|
139
|
+
|
|
137
140
|
load_dotenv()
|
|
138
141
|
|
|
139
142
|
# Determine if single or batch
|
|
@@ -259,6 +262,7 @@ def get_bool_flag(flag_name: str, default: Optional[bool] = None, **kwargs) -> b
|
|
|
259
262
|
FeatureFlagError: If fetch fails and no default provided
|
|
260
263
|
TypeError: If flag value is not a boolean
|
|
261
264
|
"""
|
|
265
|
+
return # no op for now
|
|
262
266
|
value = get_feature_flag(flag_name, default=default if default is not None else MISSING, **kwargs)
|
|
263
267
|
if not isinstance(value, bool):
|
|
264
268
|
if default is not None:
|
|
@@ -276,6 +280,7 @@ def get_int_flag(flag_name: str, default: Optional[int] = None, **kwargs) -> int
|
|
|
276
280
|
FeatureFlagError: If fetch fails and no default provided
|
|
277
281
|
TypeError: If flag value is not an integer
|
|
278
282
|
"""
|
|
283
|
+
return # no op for now
|
|
279
284
|
value = get_feature_flag(flag_name, default=default if default is not None else MISSING, **kwargs)
|
|
280
285
|
if not isinstance(value, int) or isinstance(value, bool): # bool is subclass of int
|
|
281
286
|
if default is not None:
|
|
@@ -293,6 +298,7 @@ def get_float_flag(flag_name: str, default: Optional[float] = None, **kwargs) ->
|
|
|
293
298
|
FeatureFlagError: If fetch fails and no default provided
|
|
294
299
|
TypeError: If flag value is not a float
|
|
295
300
|
"""
|
|
301
|
+
return # no op for now
|
|
296
302
|
value = get_feature_flag(flag_name, default=default if default is not None else MISSING, **kwargs)
|
|
297
303
|
if not isinstance(value, (int, float)) or isinstance(value, bool):
|
|
298
304
|
if default is not None:
|
|
@@ -310,6 +316,7 @@ def get_string_flag(flag_name: str, default: Optional[str] = None, **kwargs) ->
|
|
|
310
316
|
FeatureFlagError: If fetch fails and no default provided
|
|
311
317
|
TypeError: If flag value is not a string
|
|
312
318
|
"""
|
|
319
|
+
return # no op for now
|
|
313
320
|
value = get_feature_flag(flag_name, default=default if default is not None else MISSING, **kwargs)
|
|
314
321
|
if not isinstance(value, str):
|
|
315
322
|
if default is not None:
|
|
@@ -326,6 +333,7 @@ def get_json_flag(flag_name: str, default: Optional[dict] = None, **kwargs) -> d
|
|
|
326
333
|
Raises:
|
|
327
334
|
FeatureFlagError: If fetch fails and no default provided
|
|
328
335
|
"""
|
|
336
|
+
return # no op for now
|
|
329
337
|
value = get_feature_flag(flag_name, default=default if default is not None else MISSING, **kwargs)
|
|
330
338
|
return value
|
|
331
339
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
lucidicai/__init__.py,sha256=
|
|
1
|
+
lucidicai/__init__.py,sha256=gLCbPIuvS7-PHVVdCtmx4x-lq1yRJDEbvpqRq3-1BHw,36531
|
|
2
2
|
lucidicai/action.py,sha256=sPRd1hTIVXDqnvG9ZXWEipUFh0bsXcE0Fm7RVqmVccM,237
|
|
3
|
-
lucidicai/client.py,sha256=
|
|
3
|
+
lucidicai/client.py,sha256=IIhlY6Mfwy47FeMxzpvIygCaqcI1FnqiXiVU6M4QEiE,22327
|
|
4
4
|
lucidicai/constants.py,sha256=zN8O7TjoRHRlaGa9CZUWppS73rhzKGwaEkF9XMTV0Cg,1160
|
|
5
5
|
lucidicai/context.py,sha256=ruEXAndSv0gQ-YEXLlC4Fx6NNbaylfp_dZxbpwmLZSA,4622
|
|
6
|
-
lucidicai/dataset.py,sha256=
|
|
6
|
+
lucidicai/dataset.py,sha256=wu25X02JyWkht_yQabgQpGZFfzbNTxG6tf5k9ol8Amo,4005
|
|
7
7
|
lucidicai/decorators.py,sha256=obpHbGLhRd-yIL5xIqzjNmf-ZKCIIx5vlYnMpCcJ7Uo,5416
|
|
8
|
-
lucidicai/errors.py,sha256=
|
|
8
|
+
lucidicai/errors.py,sha256=IjnGag21aEsWryJ8hSqRMPftMeteHLQHQVZuQWl0ynM,2254
|
|
9
9
|
lucidicai/event.py,sha256=ObPXS22QIB-n4eHxzEimTtrlOxC1L6_eQVUAx4ZIT7s,2089
|
|
10
10
|
lucidicai/event_queue.py,sha256=7Y8hkrm0a7EGCBN2oW_XWd-GkJ9Cihnu2Gyk6FMftks,20065
|
|
11
|
-
lucidicai/feature_flag.py,sha256=
|
|
11
|
+
lucidicai/feature_flag.py,sha256=JRvIKUtF9d49o6L8laSg-LUfqSw-Q8QoTqin4z-wIVs,12005
|
|
12
12
|
lucidicai/image_upload.py,sha256=6SRudg-BpInM2gzMx1Yf1Rz_Zyh8inwoJ7U4pBw7ruY,3807
|
|
13
13
|
lucidicai/lru.py,sha256=PXiDSoUCOxjamG1QlQx6pDbQCm8h5hKAnnr_NI0PEgE,618
|
|
14
14
|
lucidicai/model_pricing.py,sha256=Dxi6e0WjcIyCTkVX7K7f0pJ5rPu7nSt3lOmgzAUQl1o,12402
|
|
@@ -52,7 +52,7 @@ lucidicai/telemetry/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
|
|
|
52
52
|
lucidicai/telemetry/utils/image_storage.py,sha256=4Z59ZpVexr7-lcExfr8GsqXe0y2VZmr8Yjwa-3DeOxU,1457
|
|
53
53
|
lucidicai/telemetry/utils/text_storage.py,sha256=L62MMJ8E23TDqDTUv2aRntdKMCItsXV7XjY6cFwx2DE,1503
|
|
54
54
|
lucidicai/telemetry/utils/universal_image_interceptor.py,sha256=vARgMk1hVSF--zfi5b8qBpJJOESuD17YlH9xqxmB9Uw,15954
|
|
55
|
-
lucidicai-2.0.
|
|
56
|
-
lucidicai-2.0.
|
|
57
|
-
lucidicai-2.0.
|
|
58
|
-
lucidicai-2.0.
|
|
55
|
+
lucidicai-2.0.2.dist-info/METADATA,sha256=V1siloLacf-bYmlcOYtg0Tac9ZJM3wWxDrj2Co_O498,902
|
|
56
|
+
lucidicai-2.0.2.dist-info/WHEEL,sha256=Xo9-1PvkuimrydujYJAjF7pCkriuXBpUPEjma1nZyJ0,92
|
|
57
|
+
lucidicai-2.0.2.dist-info/top_level.txt,sha256=vSSdM3lclF4I5tyVC0xxUk8eIRnnYXMe1hW-eO91HUo,10
|
|
58
|
+
lucidicai-2.0.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|