camel-ai 0.2.69a6__py3-none-any.whl → 0.2.70__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.

Potentially problematic release.


This version of camel-ai might be problematic. Click here for more details.

@@ -499,54 +499,68 @@ class WorkforceLogger:
499
499
 
500
500
  tasks_handled_by_worker: Dict[str, int] = {}
501
501
 
502
+ # Helper function to check if a task is the main task (has no parent)
503
+ def is_main_task(task_id: str) -> bool:
504
+ return (
505
+ task_id in self._task_hierarchy
506
+ and self._task_hierarchy[task_id].get('parent') is None
507
+ )
508
+
502
509
  for entry in self.log_entries:
503
510
  event_type = entry['event_type']
504
511
  timestamp = datetime.fromisoformat(entry['timestamp'])
512
+ task_id = entry.get('task_id', '')
513
+
505
514
  if first_timestamp is None or timestamp < first_timestamp:
506
515
  first_timestamp = timestamp
507
516
  if last_timestamp is None or timestamp > last_timestamp:
508
517
  last_timestamp = timestamp
509
518
 
510
519
  if event_type == 'task_created':
511
- kpis['total_tasks_created'] += 1
512
- task_creation_timestamps[entry['task_id']] = timestamp
520
+ # Exclude main task from total count
521
+ if not is_main_task(task_id):
522
+ kpis['total_tasks_created'] += 1
523
+ task_creation_timestamps[task_id] = timestamp
513
524
  elif event_type == 'task_assigned':
514
- task_assignment_timestamps[entry['task_id']] = timestamp
525
+ task_assignment_timestamps[task_id] = timestamp
515
526
  # Queue time tracking has been removed
516
527
 
517
528
  elif event_type == 'task_started':
518
529
  # Store start time for processing time calculation
519
- task_start_times[entry['task_id']] = timestamp.timestamp()
530
+ task_start_times[task_id] = timestamp.timestamp()
520
531
 
521
532
  elif event_type == 'task_completed':
522
- kpis['total_tasks_completed'] += 1
523
- # Count tasks handled by worker
524
- if 'worker_id' in entry and entry['worker_id'] is not None:
525
- worker_id = entry['worker_id']
526
- tasks_handled_by_worker[worker_id] = (
527
- tasks_handled_by_worker.get(worker_id, 0) + 1
528
- )
533
+ # Exclude main task from total count
534
+ if not is_main_task(task_id):
535
+ kpis['total_tasks_completed'] += 1
536
+ # Count tasks handled by worker (only for non-main tasks)
537
+ if 'worker_id' in entry and entry['worker_id'] is not None:
538
+ worker_id = entry['worker_id']
539
+ tasks_handled_by_worker[worker_id] = (
540
+ tasks_handled_by_worker.get(worker_id, 0) + 1
541
+ )
529
542
 
530
- if entry['task_id'] in task_assignment_timestamps:
543
+ if task_id in task_assignment_timestamps:
531
544
  completion_time = (
532
- timestamp
533
- - task_assignment_timestamps[entry['task_id']]
545
+ timestamp - task_assignment_timestamps[task_id]
534
546
  ).total_seconds()
535
547
  # Store completion time in task hierarchy instead of KPIs
536
548
  # array
537
- if entry['task_id'] in self._task_hierarchy:
538
- self._task_hierarchy[entry['task_id']][
549
+ if task_id in self._task_hierarchy:
550
+ self._task_hierarchy[task_id][
539
551
  'completion_time_seconds'
540
552
  ] = completion_time
541
553
 
542
554
  elif event_type == 'task_failed':
543
- kpis['total_tasks_failed'] += 1
544
- # Count tasks handled by worker (also for failed tasks)
545
- if 'worker_id' in entry and entry['worker_id'] is not None:
546
- worker_id = entry['worker_id']
547
- tasks_handled_by_worker[worker_id] = (
548
- tasks_handled_by_worker.get(worker_id, 0) + 1
549
- )
555
+ # Exclude main task from total count
556
+ if not is_main_task(task_id):
557
+ kpis['total_tasks_failed'] += 1
558
+ # Count tasks handled by worker (only for non-main tasks)
559
+ if 'worker_id' in entry and entry['worker_id'] is not None:
560
+ worker_id = entry['worker_id']
561
+ tasks_handled_by_worker[worker_id] = (
562
+ tasks_handled_by_worker.get(worker_id, 0) + 1
563
+ )
550
564
  error_type = entry['error_type']
551
565
  kpis['error_types_count'][error_type] = (
552
566
  kpis['error_types_count'].get(error_type, 0) + 1
@@ -26,9 +26,11 @@ from .vectordb_storages.base import (
26
26
  VectorDBQueryResult,
27
27
  VectorRecord,
28
28
  )
29
+ from .vectordb_storages.chroma import ChromaStorage
29
30
  from .vectordb_storages.faiss import FaissStorage
30
31
  from .vectordb_storages.milvus import MilvusStorage
31
32
  from .vectordb_storages.oceanbase import OceanBaseStorage
33
+ from .vectordb_storages.pgvector import PgVectorStorage
32
34
  from .vectordb_storages.qdrant import QdrantStorage
33
35
  from .vectordb_storages.tidb import TiDBStorage
34
36
  from .vectordb_storages.weaviate import WeaviateStorage
@@ -52,4 +54,6 @@ __all__ = [
52
54
  'Mem0Storage',
53
55
  'OceanBaseStorage',
54
56
  'WeaviateStorage',
57
+ 'PgVectorStorage',
58
+ 'ChromaStorage',
55
59
  ]
@@ -19,9 +19,11 @@ from .base import (
19
19
  VectorDBStatus,
20
20
  VectorRecord,
21
21
  )
22
+ from .chroma import ChromaStorage
22
23
  from .faiss import FaissStorage
23
24
  from .milvus import MilvusStorage
24
25
  from .oceanbase import OceanBaseStorage
26
+ from .pgvector import PgVectorStorage
25
27
  from .qdrant import QdrantStorage
26
28
  from .tidb import TiDBStorage
27
29
  from .weaviate import WeaviateStorage
@@ -30,6 +32,7 @@ __all__ = [
30
32
  'BaseVectorStorage',
31
33
  'VectorDBQuery',
32
34
  'VectorDBQueryResult',
35
+ 'ChromaStorage',
33
36
  'QdrantStorage',
34
37
  'MilvusStorage',
35
38
  "TiDBStorage",
@@ -38,4 +41,5 @@ __all__ = [
38
41
  'WeaviateStorage',
39
42
  'VectorRecord',
40
43
  'VectorDBStatus',
44
+ 'PgVectorStorage',
41
45
  ]