lucidicai 2.0.2__py3-none-any.whl → 2.1.1__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.
Files changed (38) hide show
  1. lucidicai/__init__.py +367 -899
  2. lucidicai/api/__init__.py +1 -0
  3. lucidicai/api/client.py +218 -0
  4. lucidicai/api/resources/__init__.py +1 -0
  5. lucidicai/api/resources/dataset.py +192 -0
  6. lucidicai/api/resources/event.py +88 -0
  7. lucidicai/api/resources/session.py +126 -0
  8. lucidicai/core/__init__.py +1 -0
  9. lucidicai/core/config.py +223 -0
  10. lucidicai/core/errors.py +60 -0
  11. lucidicai/core/types.py +35 -0
  12. lucidicai/sdk/__init__.py +1 -0
  13. lucidicai/sdk/context.py +231 -0
  14. lucidicai/sdk/decorators.py +187 -0
  15. lucidicai/sdk/error_boundary.py +299 -0
  16. lucidicai/sdk/event.py +126 -0
  17. lucidicai/sdk/event_builder.py +304 -0
  18. lucidicai/sdk/features/__init__.py +1 -0
  19. lucidicai/sdk/features/dataset.py +605 -0
  20. lucidicai/sdk/features/feature_flag.py +383 -0
  21. lucidicai/sdk/init.py +361 -0
  22. lucidicai/sdk/shutdown_manager.py +302 -0
  23. lucidicai/telemetry/context_bridge.py +82 -0
  24. lucidicai/telemetry/context_capture_processor.py +25 -9
  25. lucidicai/telemetry/litellm_bridge.py +20 -24
  26. lucidicai/telemetry/lucidic_exporter.py +99 -60
  27. lucidicai/telemetry/openai_patch.py +295 -0
  28. lucidicai/telemetry/openai_uninstrument.py +87 -0
  29. lucidicai/telemetry/telemetry_init.py +16 -1
  30. lucidicai/telemetry/utils/model_pricing.py +278 -0
  31. lucidicai/utils/__init__.py +1 -0
  32. lucidicai/utils/images.py +337 -0
  33. lucidicai/utils/logger.py +168 -0
  34. lucidicai/utils/queue.py +393 -0
  35. {lucidicai-2.0.2.dist-info → lucidicai-2.1.1.dist-info}/METADATA +1 -1
  36. {lucidicai-2.0.2.dist-info → lucidicai-2.1.1.dist-info}/RECORD +38 -9
  37. {lucidicai-2.0.2.dist-info → lucidicai-2.1.1.dist-info}/WHEEL +0 -0
  38. {lucidicai-2.0.2.dist-info → lucidicai-2.1.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,605 @@
1
+ import os
2
+ import logging
3
+ from typing import Optional, Dict, List, Any
4
+ from dotenv import load_dotenv
5
+
6
+ from ...core.errors import APIKeyVerificationError
7
+
8
+ logger = logging.getLogger("Lucidic")
9
+
10
+
11
+ def get_dataset(
12
+ dataset_id: str,
13
+ api_key: Optional[str] = None,
14
+ agent_id: Optional[str] = None,
15
+ ) -> Dict[str, Any]:
16
+ """
17
+ Get a dataset by ID with all its items.
18
+
19
+ Args:
20
+ dataset_id: The ID of the dataset to retrieve (required).
21
+ api_key: API key for authentication. If not provided, will use the LUCIDIC_API_KEY environment variable.
22
+ agent_id: Agent ID. If not provided, will use the LUCIDIC_AGENT_ID environment variable.
23
+
24
+ Returns:
25
+ A dictionary containing the dataset information including:
26
+ - dataset_id: The dataset ID
27
+ - name: Dataset name
28
+ - description: Dataset description
29
+ - tags: List of tags
30
+ - created_at: Creation timestamp
31
+ - updated_at: Last update timestamp
32
+ - num_items: Number of items in the dataset
33
+ - items: List of dataset items
34
+
35
+ Raises:
36
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
37
+ ValueError: If dataset_id is not provided.
38
+ """
39
+ load_dotenv()
40
+
41
+ # Validation
42
+ if not dataset_id:
43
+ raise ValueError("Dataset ID is required")
44
+
45
+ # Get credentials
46
+ if api_key is None:
47
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
48
+ if api_key is None:
49
+ raise APIKeyVerificationError(
50
+ "Make sure to either pass your API key into get_dataset() or set the LUCIDIC_API_KEY environment variable."
51
+ )
52
+
53
+ if agent_id is None:
54
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
55
+ if agent_id is None:
56
+ raise APIKeyVerificationError(
57
+ "Lucidic agent ID not specified. Make sure to either pass your agent ID into get_dataset() or set the LUCIDIC_AGENT_ID environment variable."
58
+ )
59
+
60
+ # Get HTTP client
61
+ from ..init import get_http
62
+ from ...core.config import SDKConfig
63
+ from ...api.client import HttpClient
64
+
65
+ http = get_http()
66
+ if not http:
67
+ # Create a new HTTP client if needed
68
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
69
+ http = HttpClient(config)
70
+
71
+ # Make request to get dataset
72
+ response = http.get('getdataset', {'dataset_id': dataset_id})
73
+
74
+ logger.info(f"Retrieved dataset {dataset_id} with {response.get('num_items', 0)} items")
75
+ return response
76
+
77
+
78
+ def get_dataset_items(
79
+ dataset_id: str,
80
+ api_key: Optional[str] = None,
81
+ agent_id: Optional[str] = None,
82
+ ) -> List[Dict[str, Any]]:
83
+ """
84
+ Convenience function to get just the items from a dataset.
85
+
86
+ Args:
87
+ dataset_id: The ID of the dataset to retrieve items from (required).
88
+ api_key: API key for authentication. If not provided, will use the LUCIDIC_API_KEY environment variable.
89
+ agent_id: Agent ID. If not provided, will use the LUCIDIC_AGENT_ID environment variable.
90
+
91
+ Returns:
92
+ A list of dataset items, where each item contains:
93
+ - datasetitem_id: The item ID
94
+ - name: Item name
95
+ - description: Item description
96
+ - tags: List of tags
97
+ - input: Input data for the item
98
+ - expected_output: Expected output data
99
+ - metadata: Additional metadata
100
+ - created_at: Creation timestamp
101
+
102
+ Raises:
103
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
104
+ ValueError: If dataset_id is not provided.
105
+ """
106
+ dataset = get_dataset(dataset_id, api_key, agent_id)
107
+ return dataset.get('items', [])
108
+
109
+
110
+ def list_datasets(
111
+ api_key: Optional[str] = None,
112
+ agent_id: Optional[str] = None,
113
+ ) -> Dict[str, Any]:
114
+ """
115
+ List all datasets for the agent.
116
+
117
+ Args:
118
+ api_key: API key for authentication. If not provided, will use the LUCIDIC_API_KEY environment variable.
119
+ agent_id: Agent ID. If not provided, will use the LUCIDIC_AGENT_ID environment variable.
120
+
121
+ Returns:
122
+ A dictionary containing:
123
+ - num_datasets: Number of datasets
124
+ - datasets: List of dataset summaries with dataset_id and name
125
+
126
+ Raises:
127
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
128
+ """
129
+ from ..init import get_resources, get_http
130
+ from ...core.config import SDKConfig
131
+ from ...api.client import HttpClient
132
+
133
+ # Get or create resources
134
+ resources = get_resources()
135
+ if not resources or 'datasets' not in resources:
136
+ load_dotenv()
137
+
138
+ # Get credentials
139
+ if api_key is None:
140
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
141
+ if api_key is None:
142
+ raise APIKeyVerificationError(
143
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
144
+ )
145
+
146
+ if agent_id is None:
147
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
148
+
149
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
150
+ http = HttpClient(config)
151
+ from ...api.resources.dataset import DatasetResource
152
+ resources = {'datasets': DatasetResource(http)}
153
+
154
+ return resources['datasets'].list_datasets(agent_id)
155
+
156
+
157
+ def create_dataset(
158
+ name: str,
159
+ description: Optional[str] = None,
160
+ tags: Optional[List[str]] = None,
161
+ suggested_flag_config: Optional[Dict[str, Any]] = None,
162
+ api_key: Optional[str] = None,
163
+ agent_id: Optional[str] = None,
164
+ ) -> Dict[str, Any]:
165
+ """
166
+ Create a new dataset.
167
+
168
+ Args:
169
+ name: Dataset name (must be unique per agent)
170
+ description: Optional dataset description
171
+ tags: Optional list of tags
172
+ suggested_flag_config: Optional flag configuration
173
+ api_key: API key for authentication
174
+ agent_id: Agent ID
175
+
176
+ Returns:
177
+ A dictionary containing dataset_id
178
+
179
+ Raises:
180
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
181
+ """
182
+ from ..init import get_resources, get_http
183
+ from ...core.config import SDKConfig
184
+ from ...api.client import HttpClient
185
+
186
+ # Get or create resources
187
+ resources = get_resources()
188
+ if not resources or 'datasets' not in resources:
189
+ load_dotenv()
190
+
191
+ if api_key is None:
192
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
193
+ if api_key is None:
194
+ raise APIKeyVerificationError(
195
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
196
+ )
197
+
198
+ if agent_id is None:
199
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
200
+
201
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
202
+ http = HttpClient(config)
203
+ from ...api.resources.dataset import DatasetResource
204
+ resources = {'datasets': DatasetResource(http)}
205
+
206
+ return resources['datasets'].create_dataset(name, description, tags, suggested_flag_config, agent_id)
207
+
208
+
209
+ def update_dataset(
210
+ dataset_id: str,
211
+ name: Optional[str] = None,
212
+ description: Optional[str] = None,
213
+ tags: Optional[List[str]] = None,
214
+ suggested_flag_config: Optional[Dict[str, Any]] = None,
215
+ api_key: Optional[str] = None,
216
+ agent_id: Optional[str] = None,
217
+ ) -> Dict[str, Any]:
218
+ """
219
+ Update dataset metadata.
220
+
221
+ Args:
222
+ dataset_id: Dataset UUID to update
223
+ name: New name (optional)
224
+ description: New description (optional)
225
+ tags: New tags (optional)
226
+ suggested_flag_config: New flag config (optional)
227
+ api_key: API key for authentication
228
+ agent_id: Agent ID
229
+
230
+ Returns:
231
+ Updated dataset data
232
+
233
+ Raises:
234
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
235
+ """
236
+ from ..init import get_resources, get_http
237
+ from ...core.config import SDKConfig
238
+ from ...api.client import HttpClient
239
+
240
+ # Get or create resources
241
+ resources = get_resources()
242
+ if not resources or 'datasets' not in resources:
243
+ load_dotenv()
244
+
245
+ if api_key is None:
246
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
247
+ if api_key is None:
248
+ raise APIKeyVerificationError(
249
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
250
+ )
251
+
252
+ if agent_id is None:
253
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
254
+
255
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
256
+ http = HttpClient(config)
257
+ from ...api.resources.dataset import DatasetResource
258
+ resources = {'datasets': DatasetResource(http)}
259
+
260
+ kwargs = {}
261
+ if name is not None:
262
+ kwargs['name'] = name
263
+ if description is not None:
264
+ kwargs['description'] = description
265
+ if tags is not None:
266
+ kwargs['tags'] = tags
267
+ if suggested_flag_config is not None:
268
+ kwargs['suggested_flag_config'] = suggested_flag_config
269
+
270
+ return resources['datasets'].update_dataset(dataset_id, **kwargs)
271
+
272
+
273
+ def delete_dataset(
274
+ dataset_id: str,
275
+ api_key: Optional[str] = None,
276
+ agent_id: Optional[str] = None,
277
+ ) -> Dict[str, Any]:
278
+ """
279
+ Delete a dataset and all its items.
280
+
281
+ Args:
282
+ dataset_id: Dataset UUID to delete
283
+ api_key: API key for authentication
284
+ agent_id: Agent ID
285
+
286
+ Returns:
287
+ Success message
288
+
289
+ Raises:
290
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
291
+ """
292
+ from ..init import get_resources, get_http
293
+ from ...core.config import SDKConfig
294
+ from ...api.client import HttpClient
295
+
296
+ # Get or create resources
297
+ resources = get_resources()
298
+ if not resources or 'datasets' not in resources:
299
+ load_dotenv()
300
+
301
+ if api_key is None:
302
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
303
+ if api_key is None:
304
+ raise APIKeyVerificationError(
305
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
306
+ )
307
+
308
+ if agent_id is None:
309
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
310
+
311
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
312
+ http = HttpClient(config)
313
+ from ...api.resources.dataset import DatasetResource
314
+ resources = {'datasets': DatasetResource(http)}
315
+
316
+ return resources['datasets'].delete_dataset(dataset_id)
317
+
318
+
319
+ def create_dataset_item(
320
+ dataset_id: str,
321
+ name: str,
322
+ input_data: Dict[str, Any],
323
+ expected_output: Optional[Dict[str, Any]] = None,
324
+ description: Optional[str] = None,
325
+ tags: Optional[List[str]] = None,
326
+ metadata: Optional[Dict[str, Any]] = None,
327
+ flag_overrides: Optional[Dict[str, Any]] = None,
328
+ api_key: Optional[str] = None,
329
+ agent_id: Optional[str] = None,
330
+ ) -> Dict[str, Any]:
331
+ """
332
+ Create a new dataset item.
333
+
334
+ Args:
335
+ dataset_id: Dataset UUID to add item to
336
+ name: Item name
337
+ input_data: Input data dictionary
338
+ expected_output: Expected output (optional)
339
+ description: Item description (optional)
340
+ tags: Item tags (optional)
341
+ metadata: Additional metadata (optional)
342
+ flag_overrides: Flag overrides (optional)
343
+ api_key: API key for authentication
344
+ agent_id: Agent ID
345
+
346
+ Returns:
347
+ Dictionary with datasetitem_id
348
+
349
+ Raises:
350
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
351
+ """
352
+ from ..init import get_resources, get_http
353
+ from ...core.config import SDKConfig
354
+ from ...api.client import HttpClient
355
+
356
+ # Get or create resources
357
+ resources = get_resources()
358
+ if not resources or 'datasets' not in resources:
359
+ load_dotenv()
360
+
361
+ if api_key is None:
362
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
363
+ if api_key is None:
364
+ raise APIKeyVerificationError(
365
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
366
+ )
367
+
368
+ if agent_id is None:
369
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
370
+
371
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
372
+ http = HttpClient(config)
373
+ from ...api.resources.dataset import DatasetResource
374
+ resources = {'datasets': DatasetResource(http)}
375
+
376
+ return resources['datasets'].create_item(
377
+ dataset_id, name, input_data,
378
+ expected_output=expected_output,
379
+ description=description,
380
+ tags=tags,
381
+ metadata=metadata,
382
+ flag_overrides=flag_overrides
383
+ )
384
+
385
+
386
+ def get_dataset_item(
387
+ dataset_id: str,
388
+ item_id: str,
389
+ api_key: Optional[str] = None,
390
+ agent_id: Optional[str] = None,
391
+ ) -> Dict[str, Any]:
392
+ """
393
+ Get a specific dataset item.
394
+
395
+ Args:
396
+ dataset_id: Dataset UUID
397
+ item_id: Item UUID
398
+ api_key: API key for authentication
399
+ agent_id: Agent ID
400
+
401
+ Returns:
402
+ Dataset item data
403
+
404
+ Raises:
405
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
406
+ """
407
+ from ..init import get_resources, get_http
408
+ from ...core.config import SDKConfig
409
+ from ...api.client import HttpClient
410
+
411
+ # Get or create resources
412
+ resources = get_resources()
413
+ if not resources or 'datasets' not in resources:
414
+ load_dotenv()
415
+
416
+ if api_key is None:
417
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
418
+ if api_key is None:
419
+ raise APIKeyVerificationError(
420
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
421
+ )
422
+
423
+ if agent_id is None:
424
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
425
+
426
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
427
+ http = HttpClient(config)
428
+ from ...api.resources.dataset import DatasetResource
429
+ resources = {'datasets': DatasetResource(http)}
430
+
431
+ return resources['datasets'].get_item(dataset_id, item_id)
432
+
433
+
434
+ def update_dataset_item(
435
+ dataset_id: str,
436
+ item_id: str,
437
+ name: Optional[str] = None,
438
+ input_data: Optional[Dict[str, Any]] = None,
439
+ expected_output: Optional[Dict[str, Any]] = None,
440
+ description: Optional[str] = None,
441
+ tags: Optional[List[str]] = None,
442
+ metadata: Optional[Dict[str, Any]] = None,
443
+ flag_overrides: Optional[Dict[str, Any]] = None,
444
+ api_key: Optional[str] = None,
445
+ agent_id: Optional[str] = None,
446
+ ) -> Dict[str, Any]:
447
+ """
448
+ Update a dataset item.
449
+
450
+ Args:
451
+ dataset_id: Dataset UUID
452
+ item_id: Item UUID
453
+ name: New name (optional)
454
+ input_data: New input data (optional)
455
+ expected_output: New expected output (optional)
456
+ description: New description (optional)
457
+ tags: New tags (optional)
458
+ metadata: New metadata (optional)
459
+ flag_overrides: New flag overrides (optional)
460
+ api_key: API key for authentication
461
+ agent_id: Agent ID
462
+
463
+ Returns:
464
+ Updated item data
465
+
466
+ Raises:
467
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
468
+ """
469
+ from ..init import get_resources, get_http
470
+ from ...core.config import SDKConfig
471
+ from ...api.client import HttpClient
472
+
473
+ # Get or create resources
474
+ resources = get_resources()
475
+ if not resources or 'datasets' not in resources:
476
+ load_dotenv()
477
+
478
+ if api_key is None:
479
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
480
+ if api_key is None:
481
+ raise APIKeyVerificationError(
482
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
483
+ )
484
+
485
+ if agent_id is None:
486
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
487
+
488
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
489
+ http = HttpClient(config)
490
+ from ...api.resources.dataset import DatasetResource
491
+ resources = {'datasets': DatasetResource(http)}
492
+
493
+ kwargs = {}
494
+ if name is not None:
495
+ kwargs['name'] = name
496
+ if input_data is not None:
497
+ kwargs['input'] = input_data
498
+ if expected_output is not None:
499
+ kwargs['expected_output'] = expected_output
500
+ if description is not None:
501
+ kwargs['description'] = description
502
+ if tags is not None:
503
+ kwargs['tags'] = tags
504
+ if metadata is not None:
505
+ kwargs['metadata'] = metadata
506
+ if flag_overrides is not None:
507
+ kwargs['flag_overrides'] = flag_overrides
508
+
509
+ return resources['datasets'].update_item(dataset_id, item_id, **kwargs)
510
+
511
+
512
+ def delete_dataset_item(
513
+ dataset_id: str,
514
+ item_id: str,
515
+ api_key: Optional[str] = None,
516
+ agent_id: Optional[str] = None,
517
+ ) -> Dict[str, Any]:
518
+ """
519
+ Delete a dataset item.
520
+
521
+ Args:
522
+ dataset_id: Dataset UUID
523
+ item_id: Item UUID
524
+ api_key: API key for authentication
525
+ agent_id: Agent ID
526
+
527
+ Returns:
528
+ Success message
529
+
530
+ Raises:
531
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
532
+ """
533
+ from ..init import get_resources, get_http
534
+ from ...core.config import SDKConfig
535
+ from ...api.client import HttpClient
536
+
537
+ # Get or create resources
538
+ resources = get_resources()
539
+ if not resources or 'datasets' not in resources:
540
+ load_dotenv()
541
+
542
+ if api_key is None:
543
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
544
+ if api_key is None:
545
+ raise APIKeyVerificationError(
546
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
547
+ )
548
+
549
+ if agent_id is None:
550
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
551
+
552
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
553
+ http = HttpClient(config)
554
+ from ...api.resources.dataset import DatasetResource
555
+ resources = {'datasets': DatasetResource(http)}
556
+
557
+ return resources['datasets'].delete_item(dataset_id, item_id)
558
+
559
+
560
+ def list_dataset_item_sessions(
561
+ dataset_id: str,
562
+ item_id: str,
563
+ api_key: Optional[str] = None,
564
+ agent_id: Optional[str] = None,
565
+ ) -> Dict[str, Any]:
566
+ """
567
+ List all sessions for a dataset item.
568
+
569
+ Args:
570
+ dataset_id: Dataset UUID
571
+ item_id: Item UUID
572
+ api_key: API key for authentication
573
+ agent_id: Agent ID
574
+
575
+ Returns:
576
+ Dictionary with num_sessions and sessions list
577
+
578
+ Raises:
579
+ APIKeyVerificationError: If API key or agent ID is missing or invalid.
580
+ """
581
+ from ..init import get_resources, get_http
582
+ from ...core.config import SDKConfig
583
+ from ...api.client import HttpClient
584
+
585
+ # Get or create resources
586
+ resources = get_resources()
587
+ if not resources or 'datasets' not in resources:
588
+ load_dotenv()
589
+
590
+ if api_key is None:
591
+ api_key = os.getenv("LUCIDIC_API_KEY", None)
592
+ if api_key is None:
593
+ raise APIKeyVerificationError(
594
+ "Make sure to either pass your API key or set the LUCIDIC_API_KEY environment variable."
595
+ )
596
+
597
+ if agent_id is None:
598
+ agent_id = os.getenv("LUCIDIC_AGENT_ID", None)
599
+
600
+ config = SDKConfig.from_env(api_key=api_key, agent_id=agent_id)
601
+ http = HttpClient(config)
602
+ from ...api.resources.dataset import DatasetResource
603
+ resources = {'datasets': DatasetResource(http)}
604
+
605
+ return resources['datasets'].list_item_sessions(dataset_id, item_id)